Add initial integration of Clad with Enzyme

Description

In mathematics and computer algebra, automatic differentiation (AD) is a set of techniques to numerically evaluate the derivative of a function specified by a computer program. Automatic differentiation is an alternative technique to Symbolic differentiation and Numerical differentiation (the method of finite differences). Clad is based on Clang which provides the necessary facilities for code transformation. The AD library is able to differentiate non-trivial functions, to find a partial derivative for trivial cases and has good unit test coverage. Enzyme is a prominent autodiff framework which works on LLVM IR.

Clad and Enzyme can be considered as a C++ frontend and a backend automatic differentiation framework. In many cases, when clad needs to fall back to numeric differentiation it can try configuring and using Enzyme to perform the automatic differentiation on lower level.

Task ideas and expected results

Understand how both systems work. Define the Enzyme configuration requirements and enable Clad to communicate efficiently with Enzyme. That may require several steps: start building and using the optimization pass of Enzyme as part of the Clad toolchain; use Enzyme for cross-validation derivative results; etc. The student should be prepared to write a progress report and present the results.

Necessary skills

Intermediate C++; Understanding basic differential calculus; intermediate knowledge of clang and llvm.

Candidate Guidelines and Evaluation

If you have interest in working on the project there is a list of things to do in order to maximize your chances to get selected:

  1. Contact the mentors and express interest in the project. Make sure you attach your CV;
  2. Download the source code of the project, build it and run the demos;
  3. Start familiarizing yourself with the codebase;
  4. If you have questions you can always contact a mentor.

The mentors are interested in working with all candidates but unfortunately the rules allow only one to be selected. There are a few tasks which give bonus points to candidate’s application:

Mentors

Additional Information

Corresponding Project

Participating Organizations