Skip to content

Add std::autodiff and Rust to the Enzyme CI #145899

Description

@ZuseZ4

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

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    A-CIArea: Our Github Actions CI
    F-autodiff`#![feature(autodiff)]`
    on Aug 26, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 26, 2025
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 26, 2025
  4. sgasho commented on Aug 29, 2025

    @sgasho
    Contributor

    @rustbot claim

  5. ratnesh-12 commented on Oct 2, 2025

    @ratnesh-12

    Hey, I'd like to work on this as my first contribution :)

  6. sgasho commented on Oct 3, 2025

    @sgasho
    Contributor

    @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 claim to 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/

  7. ZuseZ4 commented on Oct 27, 2025

    @ZuseZ4
    MemberAuthor
  8. ZuseZ4 commented on Oct 27, 2025

    @ZuseZ4
    MemberAuthor

    @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.

  9. sgasho commented on Oct 28, 2025

    @sgasho
    Contributor

    Great! I'll look into it if @ratnesh-12 doesn't respond within 24 hours.

  10. ratnesh-12 commented on Oct 28, 2025

    @ratnesh-12

    You can go ahead, I won't be able to work on this stuck with something else :) @sgasho

  11. 12 remaining items

  12. added 3 commits that reference this issue on Jan 8, 2026
  13. added a commit that references this issue on Jan 8, 2026
  14. ZuseZ4 commented on Jan 13, 2026

    @ZuseZ4
    MemberAuthor

    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.

  15. sgasho commented on Jan 13, 2026

    @sgasho
    Contributor

    you copy his pr and I delegate try rights for you, so you can experiment around with it.

    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)

  16. ZuseZ4 commented on Jan 13, 2026

    @ZuseZ4
    MemberAuthor

    Sounds good. Delegations only work per PR, but you can ping Kobzol and me once your PR against r-l/r is up.

  17. sgasho commented on Jan 13, 2026

    @sgasho
    Contributor
  18. added a commit that references this issue on May 12, 2026
  19. added a commit that references this issue on May 12, 2026
  20. added 2 commits that reference this issue on May 12, 2026
  21. added a commit that references this issue on May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-CIArea: Our Github Actions CIC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-autodiff`#![feature(autodiff)]`

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions