Fastest matrix multiplication

eveningsilverfox
Sun, 18 Feb 2024 12:38:59 +0000
General Usage

The rate determining step in my code is intermediate-sized matrix multiplications, which I have to do many many (around 10⁸) times.

using LinearAlgebra
using MKL
using BenchmarkTools

aa = rand(ComplexF64, 164,164);
bb = rand(ComplexF64, 164,164);
tta = time()
cc = aa*bb;
ttb = time()
println(" (jac) tt = ",ttb-tta)

@btime aa*bb

In my pc, the output of the println is around 0.02s, while the one with btime is around 90µs. Are there any ways to make it faster? Note that the input matrices aa and bb are freshly calculated each time I have to perform a multiplication, so converting them to a new type would also lead to added time.
Ideally, I would be dealing with matrices of size 500 times 500.

21 posts - 7 participants