3 ms·
The reason you have to optimize SIMD by hand is that compilers can't redesign your data structures and algorithms. This is the level of abstraction at which you
by jandrewrogers 1y ago
The reason you have to optimize SIMD by hand is that compilers can't redesign your data structures and algorithms. This is the level of abstraction at which you often need to be working with SIMD. Compilers are limited to codegen things like auto-vectorizing simple loops, but that isn't where most of the interesting possibilities are with SIMD.
If you look at heavily-optimized SIMD code side-by-side with the equivalent heavily-optimized scalar code, they are often almost entirely unrelated implementations. That's the part compilers can't do.
Note that I use SIMD heavily in a lot of domains that aren't just brute-forcing a lot straightforward numerics. If you are just brute-forcing numerics, that auto-vectorization works pretty well. For example, I have a high-performance I/O scheduler that is almost pure AVX-512 and the compiler can't vectorize any of that.
- lenkite 1y agoHope you one day can get around to writing some blog posts or maybe even publish some books/courses on this - it sounds interesting!
- dwood_dev 1y agoYou'll find the video in this submission a fun watch if you want to learn a bit about optimization and AVX-512. https://news.ycombinator.com/item?id=44176729 https://news.ycombinator.com/item?id=44176729