[llvm-dev] [GSoC 2021] Some ideas & questions about the Enzyme GSoC project

Chuyang Chen via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 30 08:44:06 PDT 2021


Hello, I'm working on the GSoC project "Integrate Enzyme into Rust to
provide high-performance differentiation in Rust". I have skimmed over the
codebase and now I have some preliminary ideas about the project.

 

As you have said, the project can be divided to two main parts:

1.      passing and parsing Rust type metadata into LLVM / Enzyme type
analysis, and

2.      integrating the Enzyme API/pass into rust.

 

Integrating Enzyme API to rust is trivial by using proc_macros in Rust.
However, passing Rust type metadata to LLVM and integrating the Enzyme pass
into rust is difficult if we don't modify the Rust compiler. The Rust
compiler seems to lack ability to emit metadata to LLVM, and if we want to
add the Enzyme pass without modifying the compiler, the only way is, I
think, using a command like



which is not user-friendly. I sought hard for a nonintrusive way to
implement them but got nothing, so it seems that the only option is
modifying the Rust compiler to let it

1.      emit extra debuginfo to the generated IR code, and

2.      use lld as its linker and add the Enzyme pass to lld

with a specific option, say "--enzyme"

 

However, is it appropriate to modify the compiler to just port a plugin to
it, though the modification won't be big or impact the rest of the compiler?

 

PS: Another question is about differentiating closures in Rust, but that can
be postponed to the following discussions.

 

Chuyang Chen

MSc Student

At Department of Computer Science and Technology, Nanjing University

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210330/4e9c701e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 29102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210330/4e9c701e/attachment.png>


More information about the llvm-dev mailing list