On my AVX2 laptop, sparse multiplication now turns out to be slower than the non-sparse multiplication. I suspect that this is not the case on some other AVX2 CPUs, in particular Zen 1.
I have therefore added a compilation option.
To compile with sparse multiplication: make -j pgo sparse=yes
To compile without sparse multiplication: make -j pgo sparse=no
By default "sparse=yes" except for AVX2 targets (including BMI2, VNNI, AVX512).
If it is clear that "sparse=no" is still faster on Zen 1 or on other CPUs with AVX2, I can make it the default on those CPUs. I cannot test this myself, so if anyone is willing to try sparse=yes/no on Zen 1 or other CPUs, that would be very welcome.
It would also be interesting to know if sparse=no is faster on any non-AVX2 CPUs.
On my AVX2 laptop, sparse multiplication now turns out to be slower than the non-sparse multiplication. I suspect that this is not the case on some other AVX2 CPUs, in particular Zen 1.
I have therefore added a compilation option.
To compile with sparse multiplication:
make -j pgo sparse=yesTo compile without sparse multiplication:
make -j pgo sparse=noBy default "sparse=yes" except for AVX2 targets (including BMI2, VNNI, AVX512).
If it is clear that "sparse=no" is still faster on Zen 1 or on other CPUs with AVX2, I can make it the default on those CPUs. I cannot test this myself, so if anyone is willing to try sparse=yes/no on Zen 1 or other CPUs, that would be very welcome.
It would also be interesting to know if sparse=no is faster on any non-AVX2 CPUs.