proteneer / Enzyme

High-performance automatic differentiation of LLVM.

Home Page:https://enzyme.mit.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Enzyme High-Performance Automatic Differentiator of LLVM

Enzyme is a plugin that performs automatic differentiation (AD) of statically analyzable LLVM.

Enzyme can be used by calling __enzyme_autodiff on a function to be differentiated as shown below. Running the Enzyme transformation pass then replaces the call to __enzyme_autodiff with the gradient of its first argument.

double foo(double);

double grad_foo(double x) {
    return __enzyme_autodiff(foo, x);
}

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.

Detailed information on installing and using Enzyme can be found on our website: https://enzyme.mit.edu.

A short example of how to install Enzyme is below:

cd /path/to/Enzyme/enzyme
mkdir build && cd build
cmake -G Ninja .. -DLLVM_DIR=/path/to/llvm/lib/cmake/llvm -DLLVM_EXTERNAL_LIT=/path/to/lit/lit.py
ninja

To get involved or if you have questions, please join our mailing list.

If using this code in an academic setting, please cite the following:

@incollection{enzymeNeurips,
title = {Instead of Rewriting Foreign Code for Machine Learning, Automatically Synthesize Fast Gradients},
author = {Moses, William S. and Churavy, Valentin},
booktitle = {Advances in Neural Information Processing Systems 33},
year = {2020},
note = {To appear in},
}

Julia bindings for Enzyme are available here

About

High-performance automatic differentiation of LLVM.

https://enzyme.mit.edu

License:Other


Languages

Language:C++ 47.0%Language:LLVM 24.5%Language:C 11.0%Language:Assembly 9.2%Language:HTML 4.1%Language:Python 1.5%Language:Objective-C 1.3%Language:Objective-C++ 0.4%Language:CMake 0.3%Language:Shell 0.2%Language:Cuda 0.1%Language:OCaml 0.1%Language:Perl 0.1%Language:Makefile 0.1%Language:Go 0.0%Language:Awk 0.0%Language:JavaScript 0.0%Language:M4 0.0%Language:TeX 0.0%Language:CSS 0.0%Language:C# 0.0%Language:MATLAB 0.0%Language:Emacs Lisp 0.0%Language:Roff 0.0%Language:Batchfile 0.0%Language:Smalltalk 0.0%Language:Vim Script 0.0%Language:Mathematica 0.0%Language:Julia 0.0%Language:Ruby 0.0%Language:Fortran 0.0%Language:Dockerfile 0.0%Language:Cool 0.0%Language:NASL 0.0%Language:M 0.0%Language:TypeScript 0.0%Language:SuperCollider 0.0%Language:AppleScript 0.0%Language:Mercury 0.0%Language:Forth 0.0%Language:RenderScript 0.0%Language:DTrace 0.0%Language:Swift 0.0%Language:SWIG 0.0%Language:Rust 0.0%Language:Logos 0.0%