Contributor
Manish Kausik

Add Initial Integration of Clad with Enzyme


Mentors
Vassil Vassilev, David Lange, William Moses
Organization
CERN-HSF
Technologies
llvm, c++, clang
Topics
Compiler design, Automatic Differentiation
Clad is an open source plugin to the Clang compiler that detects from the parsed Abstract syntax tree, calls to differentiate a defined function, generates code that differentiates the function using the concept of Automatic Differentiation(AD) and modifies the Abstract Syntax Tree(AST) to insert the generated code. While clad works in the frontend of the compilation process, Enzyme, another LLVM based AD plugin works in the backend, where it takes in code in LLVM IR form and then differentiates the code. This proposal aims to integrate Clad with Enzyme, and give the user the option of selecting Enzyme for Automatic Differentiation, based on his/her needs. This will give the user the same User Interface as clad for writing his/her code, but the option of using Enzyme as the backend with all its optimisations to calculate the Derivative/Gradient of the requested function. This proposal also briefly gives insights into how this can be achieved by tapping into the existing code base of Clad.