With a surge of machine learning, especially the neural network model which needs to compute a huge amount of gradients, more and more languages' users begin to call for the ability to do high-performance and convenient automatic differentiation (hereafter AD) on functions, whereupon many AD tools are developed, among which is Enzyme. Enzyme is made as a plugin of LLVM and synthesizes differentiated functions directly on optimized LLVM IR code, which provides it with advantages in efficiency and universality. From another aspect, Rust is an emerging high-performance and safe language. Many of its users are trying to bring machine learning to it, thus an high-performance and user-friendly AD tool needed. Enzyme is a good option for this demand. However, without a deep integration into Rust, Enzyme's user experience with Rust is not so good, and more importantly, it may suffer from performance reduction due to wasted Rust meta-information. These problems hamper Enzyme from being widely used in Rust. This project will tackle the aforementioned problems through integrating Enzyme into Rust and then provide high-performance differentiation in Rust.


Chuyang Chen


  • William Moses
  • Johannes Doerfert