Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Personally I really don't want new GPU languages that do not have AD as a first class citizen. I mean rust is an improvement over C++ CUDA but still.


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 (it is still at a pre-RFC stage so it is not something that soon will be added)


Incredible, 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.


It makes use of 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.


You can read some motivation for it at the following link

https://rust-lang.github.io/rust-project-goals/2024h2/Rust-f...

note that it also discusses `std::offload`, which might also be of interest.


That's awesome, I didn't know that!


Sorry, what is AD in this context?

edit: oh, automatic differentiation?


Active Directory


This isn't a new GPU language; it's a lib which might replace FFI and third party libs.


This is definitely not just a lib. This compiles rust to CUDA. If you call a full on compiler stack a lib, everything may as well be a lib.


Ok. I am calling it a lib because to use, you add it as a dependency in cargo.toml then import it in your rust modules.


That's after you have installed their entire build infra + dependencies. They ship their own cargo subcommand.


Really hard to find alternatives to Julia for AD as a first class citizen


I think the parent is mostly referring to solutions like Slang.D



every GPU related post has a comment which makes my eyes roll all the way back. this is the one for this post.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: