Open fenrus75 opened 5 years ago
There is still plenty of those CPUs around. Like simplistic threshold M<-16 N<=16 K<=16 ?
it goes further out than that, up to M N K = 4 512 512
(outside of that there's still wins but also some losses)
Is "at least one of M, N, K below 64" too simplistic ?
it will be correct, but the optimization goes further out than that. the MNK multiple is the best test I've found so far
(I created a few thousand random M/N/K points, measured and tried to find a decent algorithm that gets as much of the gains as possible without reaching to where it hurts)
example from above: 256 256 8 gets almost a 2x increase.
Hi all, excuse me, I have a related question. Could you tell, how you created the version for AVX2? How can one optimize any function in the library for AVX2? Are there special compiler flags? Thank you.
@MikhailOvs if you have a good knowledge of AVX2 mnemonics (or the corresponding intrinsics for C), either start from the assembly output of a compiler for a plain C implementation of the function (gcc -mavx2 -S simplefunction.c), or write from scratch. Unfortunately there are a lot fewer developers who can/will do this, than users of an existing library like OpenBLAS...
I've created a version of the direct sgemm code for AVX2 (it's shared with the AVX512 code with very limited ifdefs, so can compile from the same source). Question is if and how to integrate.
The performance behavior is a bit different; AVX2 has fewer and more narrow registers which means that the max matrix size where the direct mode helps is quite a bit smaller than the AVX512 version... so question is if this matters enough.
Performance is roughly like this (slightly rough numbers, so assume 2%-ish run to run variation, more than usual)