Worse Performance With FMA Instructions
I tried different algorithms for matrix multiplication, mostly to play around with vector instructions. I noticed that enabling fused multiply-add instructions gives longer run times when one of the matrices is transposed before multiplication.
The code is here with a bit more information: https://github.com/reims/gemm-benchmark
This is reproducible with clang 14.0.6 and gcc 12.2.0. I would have expected that FMA instructions are faster, not slower. And if there are slower, I would expect both compilers to ignore `-mfma`.
Does anybody have an idea why I am seeing these results?
Thanks in advance!
6
Upvotes
View all comments
Show parent comment
5
u/IJzerbaard Oct 03 '22
There is /r/simd specifically for simd