4 ms·
It’s a good start, but you can’t generally get even remotely close to hardware potential in Rust, let alone Python. I had to implement a separate C99 library t
by ashvardanian 3y ago
It’s a good start, but you can’t generally get even remotely close to hardware potential in Rust, let alone Python.
I had to implement a separate C99 library to always trigger the newest SIMD intrinsics, occasionally leveraging SVE on more recent ARM CPUs, that compilers don’t know how to generate.
That library is in turn used in USearch, which is designed for Approximate Search, but some users recently reported that they use it for brute force as well… where it performed 20x faster than FAISS.
https://github.com/ashvardanian/simsimd https://github.com/ashvardanian/simsimd
- bluejekyll 3y ago> you can’t generally get even remotely close to hardware potential in Rust Can you express the gaps you’re aware of in regards to Rust’s ability to SIMD? There has been a lot of work in Rust and LLVM to make these things work. I’m mostly just curious with your experience in this area. Here’s some of the detection available in Rust in this area, and I know there is more out there: https://doc.rust-lang.org/core/arch/ https://doc.rust-lang.org/core/arch/
- jackmott42 3y agoRust supports SIMD intrinsics
- eigenvalue 3y agoYes, and I believe the latest Rust toolchain is even able to automatically vectorize certain operations using SIMD primitives without explicitly specifying them in the Rust code. There has been a lot of recent work in Rust and LLVM to support that sort of thing, although that stuff is a bit over my pay grade.
- steveklabnik 3y agoThat's not "the latest" Rust toolchain, LLVM has been able to do this for a long time. Of course, it gets better and better over time.
- eigenvalue 3y agoYes, you're right of course. I meant more that it's getting better recently, and it's an active area of work in the Rust and LLVM dev communities. So if your last experience with this was a few years ago, it's worth checking it out again because it's actively improving.
- deleted 3y ago[deleted]
- eigenvalue 3y agoCool. I considered trying to use SIMD tricks, but then it starts becoming very platform dependent and I wanted to keep it general. My version is already by far the fastest Hoeffding's D implementation available for use in Python, so it's quite useful even without leveraging every possible optimization. I'll check out your library though, sounds cool. The link you shared gives a 404 though.
- ashvardanian 3y agoUpdated, thanks :)