|
1 | | -# <img src="https://enzyme.mit.edu/logo.svg" width="75" align=left> The Enzyme High-Performance Automatic Differentiator of LLVM and MLIR |
2 | | - |
3 | | - |
4 | | -Enzyme is a plugin that performs automatic differentiation (AD) of statically analyzable LLVM and MLIR. |
5 | | - |
6 | | -Enzyme can be used by calling `__enzyme_autodiff` on a function to be differentiated as shown below. |
7 | | -Running the Enzyme transformation pass then replaces the call to `__enzyme_autodiff` with the gradient of its first argument. |
8 | | -```c |
9 | | -double foo(double); |
10 | | - |
11 | | -double grad_foo(double x) { |
12 | | - return __enzyme_autodiff(foo, x); |
13 | | -} |
14 | | -``` |
15 | | -
|
16 | | -Enzyme is highly-efficient and its ability to perform AD on optimized code allows Enzyme to meet or exceed the performance of state-of-the-art AD tools. |
17 | | -
|
18 | | -<div style="padding:2em"> |
19 | | -<img src="https://enzyme.mit.edu/all_top.png" width="500" align=center> |
20 | | -</div> |
21 | | -
|
22 | | -Detailed information on installing and using Enzyme can be found on our website: [https://enzyme.mit.edu](https://enzyme.mit.edu). |
23 | | -
|
24 | | -A short example of how to install Enzyme is below: |
25 | | -``` |
26 | | -cd /path/to/Enzyme/enzyme |
27 | | -mkdir build && cd build |
28 | | -cmake -G Ninja .. -DLLVM_DIR=/path/to/llvm/lib/cmake/llvm -DLLVM_EXTERNAL_LIT=/path/to/lit/lit.py |
29 | | -ninja |
30 | | -``` |
31 | | -
|
32 | | -Or, install Enzyme using a package manager: |
33 | | -
|
34 | | -[Homebrew](https://brew.sh) |
35 | | -``` |
36 | | -brew install enzyme |
37 | | -``` |
38 | | -[Spack](https://spack.io) |
39 | | -``` |
40 | | -spack install enzyme |
41 | | -``` |
42 | | -
|
43 | | -To get involved or if you have questions, please join our [mailing list](https://groups.google.com/d/forum/enzyme-dev). |
44 | | -
|
45 | | -If using this code in an academic setting, please cite the following three papers (first for Enzyme as a whole, second for GPU+optimizations, and third for AD of all other parallel programs (OpenMP, MPI, Julia Tasks, etc.)): |
46 | | -``` |
47 | | -@inproceedings{NEURIPS2020_9332c513, |
48 | | - author = {Moses, William and Churavy, Valentin}, |
49 | | - booktitle = {Advances in Neural Information Processing Systems}, |
50 | | - editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin}, |
51 | | - pages = {12472--12485}, |
52 | | - publisher = {Curran Associates, Inc.}, |
53 | | - title = {Instead of Rewriting Foreign Code for Machine Learning, Automatically Synthesize Fast Gradients}, |
54 | | - url = {https://proceedings.neurips.cc/paper/2020/file/9332c513ef44b682e9347822c2e457ac-Paper.pdf}, |
55 | | - volume = {33}, |
56 | | - year = {2020} |
57 | | -} |
58 | | -@inproceedings{10.1145/3458817.3476165, |
59 | | -author = {Moses, William S. and Churavy, Valentin and Paehler, Ludger and H\"{u}ckelheim, Jan and Narayanan, Sri Hari Krishna and Schanen, Michel and Doerfert, Johannes}, |
60 | | -title = {Reverse-Mode Automatic Differentiation and Optimization of GPU Kernels via Enzyme}, |
61 | | -year = {2021}, |
62 | | -isbn = {9781450384421}, |
63 | | -publisher = {Association for Computing Machinery}, |
64 | | -address = {New York, NY, USA}, |
65 | | -url = {https://doi.org/10.1145/3458817.3476165}, |
66 | | -doi = {10.1145/3458817.3476165}, |
67 | | -booktitle = {Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis}, |
68 | | -articleno = {61}, |
69 | | -numpages = {16}, |
70 | | -keywords = {CUDA, LLVM, ROCm, HPC, AD, GPU, automatic differentiation}, |
71 | | -location = {St. Louis, Missouri}, |
72 | | -series = {SC '21} |
73 | | -} |
74 | | -@inproceedings{10.5555/3571885.3571964, |
75 | | -author = {Moses, William S. and Narayanan, Sri Hari Krishna and Paehler, Ludger and Churavy, Valentin and Schanen, Michel and H\"{u}ckelheim, Jan and Doerfert, Johannes and Hovland, Paul}, |
76 | | -title = {Scalable Automatic Differentiation of Multiple Parallel Paradigms through Compiler Augmentation}, |
77 | | -year = {2022}, |
78 | | -isbn = {9784665454445}, |
79 | | -publisher = {IEEE Press}, |
80 | | -booktitle = {Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis}, |
81 | | -articleno = {60}, |
82 | | -numpages = {18}, |
83 | | -keywords = {automatic differentiation, tasks, OpenMP, compiler, Julia, parallel, Enzyme, C++, RAJA, hybrid parallelization, MPI, distributed, LLVM}, |
84 | | -location = {Dallas, Texas}, |
85 | | -series = {SC '22} |
86 | | -} |
87 | | -``` |
88 | | -
|
89 | | -Both [Julia bindings](https://github.com/wsmoses/Enzyme.jl) and [Rust bindings](https://github.com/rust-ml/oxide-enzyme) are available for Enzyme. |
| 1 | +Work in this repository has been fully incorporated into the main Enzyme repository at github.com/EnzymeAD/Enzyme . |
0 commit comments