Skip to content

Add Enzyme to build-manifest and rustup#154754

Open
Kobzol wants to merge 2 commits intorust-lang:mainfrom
Kobzol:build-manifest-enzyme
Open

Add Enzyme to build-manifest and rustup#154754
Kobzol wants to merge 2 commits intorust-lang:mainfrom
Kobzol:build-manifest-enzyme

Conversation

@Kobzol
Copy link
Copy Markdown
Member

@Kobzol Kobzol commented Apr 3, 2026

This PR adds the autodiff component (Enzyme) to build-manifest, and thus also to (nightly) Rustup.

It is marked as nightly-only and as -preview.

After this PR lands, unless I messed something up, starting with the following nightly, the following should work (on supported targets):

rustup +nightly component add enzyme
RUSTFLAGS="-Zautodiff=Enable" cargo +nightly build

CC @ZuseZ4

r? @Mark-Simulacrum

closes: #145899

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 3, 2026
@ZuseZ4
Copy link
Copy Markdown
Member

ZuseZ4 commented Apr 4, 2026

I just went over the error messages and noticed we never mentioned Enzyme anywhere there. The only place I mention it are developer docs. We also called the feature autodiff, so I guess to stay consistent for users at least the user-facing name here should also be autodiff.

Also, can you update

#[note("it will be distributed via rustup in the future")]
to say that autodiff might be available as a nightly component?

@ZuseZ4 ZuseZ4 added the F-autodiff `#![feature(autodiff)]` label Apr 4, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

r=me in principle, feel free to rename etc if that makes sense

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2026
@mati865
Copy link
Copy Markdown
Member

mati865 commented Apr 5, 2026

Should it be documented somewhere which hosts ship prebuilt Enzyme, even though it's still nightly?

@ZuseZ4
Copy link
Copy Markdown
Member

ZuseZ4 commented Apr 6, 2026

I'll add it to the autodiff dev guide once it lands, and mention the two supported targets in the irlo announcement blog post if it works as expected. Together with the updated error message, I think that should be enough.

There isn't any ongoing work to port more targets to dynamic LLVM linking outside of macOS, and macOS is going slow due to the breakages. At the current pace I don't think we need more than that, until someone starts tackling the remaining targets.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…i-obk

Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…i-obk

Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…i-obk

Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…i-obk

Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
@Kobzol
Copy link
Copy Markdown
Member Author

Kobzol commented Apr 7, 2026

I just went over the error messages and noticed we never mentioned Enzyme anywhere there. The only place I mention it are developer docs. We also called the feature autodiff, so I guess to stay consistent for users at least the user-facing name here should also be autodiff.

Hmm, not sure if I agree with autodiff. At the very least it should be something like autodiff-enzyme or something, we might have a different autodiff mechanism in the future, in theory. But we just call components by their name and not their function, i.e. we have "rust-analyzer", and not "ide-engine", we have "clippy" and not "linter" etc. So I'd just use the name of the thing we ship directly.

rust-timer added a commit that referenced this pull request Apr 7, 2026
Rollup merge of #154795 - ZuseZ4:autodiff-general-docs, r=oli-obk

Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: #154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 8, 2026
Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang/rust#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Apr 9, 2026
Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: rust-lang/rust#154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-autodiff `#![feature(autodiff)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add std::autodiff and Rust to the Enzyme CI

5 participants