Repository navigation
Add std::autodiff and Rust to the Enzyme CI #145899
Description
std::autodiff is currently not build in CI, which causes unfortunate regressions every once in a while.
Enabling autodiff on nightly would either require approval on the infra side, since the rustc binary would become [larger](#t-infra > MCP - Enable autodiff in CI) on every (supported) platform, or someone would need to implement #143295.
std::autodiff (as well as the upcoming std::batching) is based on https://github.com/enzymead/enzyme, an LLVM incubator project. So a simpler alternative to building Enzyme in the Rust CI would be to build Rust in the Enzyme CI. They have 32 core runners available, so build times should be acceptable. Enzyme currently has integration tests for C++, Julia, and MLIR, so there are plenty of examples to copy. We have build instructions for rustc with std::autodiff enabled in the rustc-dev-guide. As another related example, here is a discussion from the time where we added Rust to the Enzyme compiler explorer: EnzymeAD/enzyme-explorer#15
The goal for now is to just check in the Enzyme CI that the four x.py test autodiff test commands from the dev-guide pass.
I think the task should be sufficiently easy for anyone who previously worked with Docker or the github CI. In the long run we probably want both CIs to build both Enzyme and rustc, but it would be a good improvement for now.
If anyone wants to claim and has question, feel free to either ask them here (and cc @ wsmoses) or create an issue over at https://github.com/EnzymeAD/Enzyme, either works.
Activity
sgasho commentedon Aug 29, 2025
@rustbot claim
ratnesh-12 commentedon Oct 2, 2025
Hey, I'd like to work on this as my first contribution :)
sgasho commentedon Oct 3, 2025
@ratnesh-12
I'm currently working on this issue and it should be finished soon.
If you are looking for related issues to work on, you can find some with A-CI labels from below.
https://github.com/rust-lang/rust/issues?q=state%3Aopen%20label%3A%22A-CI%22
You can also use the command
(at)rustbot claimto assign yourself to an issue that you would like to work on if nobody else does so first.cf. https://rustc-dev-guide.rust-lang.org/
ZuseZ4 commentedon Oct 27, 2025
closed by @sgasho in EnzymeAD/Enzyme#2430
ZuseZ4 commentedon Oct 27, 2025
@ratnesh-12 (or @sgasho if you want to continue)
There is #146623 as the last blocker before the Rust infra team can enable ad in Rust CI, if one of you wants to look into it.
It used to work, but before it landed one of the gsoc projects added support for generating enzyme typetrees, so now this pr needs to be updated to also handle all of those new typetree functions.
sgasho commentedon Oct 28, 2025
Great! I'll look into it if @ratnesh-12 doesn't respond within 24 hours.
ratnesh-12 commentedon Oct 28, 2025
You can go ahead, I won't be able to work on this stuck with something else :) @sgasho
12 remaining items
Rollup merge of rust-lang#150696 - fix/liloading-enzyme-err, r=ZuseZ4
Rollup merge of rust-lang#150696 - fix/liloading-enzyme-err, r=ZuseZ4
Rollup merge of rust-lang#150747 - fix/liloading-enzyme-err, r=lqd
Unrolled build for #150747
ZuseZ4 commentedon Jan 13, 2026
Yes, you can either ping kobzol in the pr you linked and ask him to also create a macos-enzyme artifact in the same way for you, or you copy his pr and I delegate try rights for you, so you can experiment around with it.
local dist builds also work for me, it seems that CI environments differ enough from those that at least on linux I can't use the CI libEnzyme.
sgasho commentedon Jan 13, 2026
Great! Could you delegate the try rights for me? I already copied his pr and enabled to dist enzyme artifact for macos on my local machine.
I think I can publish a draft pr and try to run CI today(within around 15 hours)
ZuseZ4 commentedon Jan 13, 2026
Sounds good. Delegations only work per PR, but you can ping Kobzol and me once your PR against r-l/r is up.
sgasho commentedon Jan 13, 2026
Auto merge of #154754 - Kobzol:build-manifest-enzyme, r=Mark-Simulacr…
Rollup merge of rust-lang#154754 - Kobzol:build-manifest-enzyme, r=Ma…
Auto merge of #154754 - Kobzol:build-manifest-enzyme, r=Mark-Simulacr…
Auto merge of #154754 - Kobzol:build-manifest-enzyme, r=Mark-Simulacr…
Unrolled build for #154754
Rollup merge of #154754 - Kobzol:build-manifest-enzyme, r=Mark-Simula…