Hmm, as a reference, this is my performance numbers on a Ryzen 3700X:
MATLAB R2021b
>> A = rand(4000); f = @() inv(A); timeit(f)
ans =
0.5925
>> version -blas
ans =
'Intel(R) Math Kernel Library Version 2019.0.3 Product Build 20190125 for Intel(R) 64 architecture applications, CNR branch auto'
Julia with OpenBLAS
julia> VERSION
v"1.7.0-rc1"
julia> using LinearAlgebra, BenchmarkTools
julia> A = rand(4000,4000);
julia> @btime inv($A);
753.273 ms (6 allocations: 124.05 MiB)
julia> LinearAlgebra.versioninfo()
BLAS: libblastrampoline (f2c_capable)
--> /home/trostaft/Documents/AcademicFiles/Software/julia-1.7.0-rc1/bin/../lib/julia/libopenblas64_.so (ILP64)
Julia with MKL
julia> VERSION
v"1.7.0-rc1"
julia> using LinearAlgebra, BenchmarkTools
julia> using MKL
julia> A = rand(4000,4000);
julia> @btime inv($A);
688.735 ms (6 allocations: 124.05 MiB)
julia> LinearAlgebra.versioninfo()
BLAS: libblastrampoline (f2c_capable)
--> /home/trostaft/.julia/artifacts/72d4adc3ef9236a92f4fefeb0291cb6e8aaae2d7/lib/libmkl_rt.so (ILP64)
So, despite the fact that I’m on an AMD CPU, MKL still results in a performance improvement for inv
over OpenBLAS. Upping the size of the matrix, the performance gain from OpenBLAS and MKL is still around 13%.