5 ms·
There is actually work on adding autodiff to Rust, maybe not really first class citizen, but at least build in: https://doc.rust-lang.org/std/autodiff/index.htm
by erk__ 4mo ago
There is actually work on adding autodiff to Rust, maybe not really first class citizen, but at least build in: https://doc.rust-lang.org/std/autodiff/index.html https://doc.rust-lang.org/std/autodiff/index.html (it is still at a pre-RFC stage so it is not something that soon will be added)
- magnio 4mo agoIncredible, I have never heard of std::autodiff before. Isn't it rare for a programming language to provide AD within the standard library? Even Julia doesn't have it built-in, I wouldn't expect Rust out of all languages to experiment it in std.
- xkevio 4mo agoIt makes use of https://github.com/EnzymeAD/enzyme https://github.com/EnzymeAD/enzyme which is an LLVM plugin and since Rust also uses LLVM in its backend, we can enable this plugin in our Rust toolchain when autodiff is enabled. So, it is a bit of compiler black magic rather than a direct implementation in the standard library.
- mswphd 4mo agoYou can read some motivation for it at the following link https://rust-lang.github.io/rust-project-goals/2024h2/Rust-for-SciComp.html?highlight=autodiff#autodiff https://rust-lang.github.io/rust-project-goals/2024h2/Rust-f... note that it also discusses `std::offload`, which might also be of interest.
- rowanG077 4mo agoThat's awesome, I didn't know that!