r/rust • u/frozen_beak • 11h ago
🧠educational Devlog: Optimizing f64 GEMM from 6.5 to ~40 GFLOP/s with a BLIS-style micro-kernel
https://adii.fyi/blog/optimizing-matmul-in-rust-from-naive-loops-to-blis/
I wanted to see how far I could push a single-threaded f64 matmul. Started with the usual i-k-j loop, and then spent quite a bit of time looking at asm, then experimenting with SIMD, and eventually working through BLIS-style blocking and packing.
Writing this up was a good way to document the whole process, so thought I'd share it here.
0
Upvotes
0
u/codear 1h ago
While gains are indisputable, the tradeoff of this approach is a platform lock. And not just that - the system needs to support the very instructions you used.
I'm a bit surprised rust doesn't allow you to tap into vector instructions without inline assembly. I did some of that (vector optimizations) out of my curiosity and did not have to go that low.
Cool to see the potential but not sure if the benefits are worth the cost