[GSOC 2022] [Enzyme] Moving Instruction Rules to Tablegen

Description of the project: Enzyme performs automatic differentiation (in the calculus sense) of LLVM programs. This enables users to use Enzyme to perform various algorithms such as back-propagation in ML or scientific simulation on existing code for any language that lowers to LLVM.
The support for an increasing number of LLVM Versions (7-main), AD modes (Reverse, Forward, Forward-Vector, Reverse-Vector, Jacobian), and libraries (BLAS, OpenMP, MPI, CUDA, ROCm, …) leads to a steadily increasing code base. In order to limit complexity and help new contributors we would like to express our core logic using LLVM Tablegen. The applicant is free to decide how to best map the program transformation abstractions within Enzyme to Tablegen

Expected results:

  • A working tablegen rule generation system within Enzyme
  • Moving several existing rules to the new autogenerated system (e.g. LLVM instructions, LLVM intrinsics, BLAS calls, MPI calls, …)

Desirable skills: Good knowledge of C++, calculus, and LLVM and/or Clang, and/or MLIR internals. Experience with Tablegen, Enzyme or automatic differentiation would be nice, but can also be learned in the project.

Mentors: William Moses (@wsmoses), Valentin Churavy (@vchuravy)

Project type: Large

Hi, This project sounds interesting. During my time in undergrad and grad school, I majored in Applied Math and had lots of exposure to machine learning. I was wondering if you are still looking for people to help out on your open source project and what are some major projects that need to be worked on.

Hi. As previously mentioned in the LLVM Discord server, I am also interested in contributing to this project. I possess extensive experience in modern C++ (17/20/23), LLVM IR (refer to one of my repo - GitHub - PragmaTwice/codepunk: [WIP] Interval Analysis on LLVM IR), Clang frontend (having completed an internship about Clang StaticAnalyzer and Clang Tidy), TableGen (I am the author of Oneflow TableGen - oneflow/tools/oneflow-tblgen at master · Oneflow-Inc/oneflow · GitHub). Additionally, I have been actively participating in open-source communities such as Apache Kvrocks, where I hold the position of a PMC member. I wonder if any open positions are currently available for this project. For further details on my work, check my GitHub profile - PragmaTwice (Twice) · GitHub :slight_smile:

Hi @wu-s-john @PragmaTwice, we do!
Please excuse the delay, I didn’t subscribe to this proposal from last year.
Please feel free to dm me if you already have something more specific in mind,
otherwise I’ll send you list of possible tasks tomorrow morning.