Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6539 Discussions

Which algorithm is implemented in DGEMM?

Laasner__Raul
Beginner
378 Views

Interestingly, I've been unable to find an answer to this simple question. What is the algorithm that is used for matrix-matrix multiplications (e.g., DGEMM) in MKL? Is is classical (O(N^3)), Strassen (O(N^2.7)), or something else? Thanks.

0 Kudos
1 Reply
Zhen_Z_Intel
Employee
378 Views

Hi Raul,

I am afraid BLAS standard gemm uses classical O(N3), for algorithm design, you could follow Netlib gemm source code. Intel MKL optimized BLAS routines with SIMD instruction sets, do some work to fit data into the caches enabling contiguous, aligned accesses.

Here's another algorithm for matrix matrix multiplication, call 3M. It split a complex matrix into two matrices, performs 3 GEMM and 4 matrix additions. For other algorithm, like Winograd which implemented for NN convolution kernel in MKL-DNN.

Reply