4 ms·
> There’re vendor-agnostic equivalents like Eigen. That's looking at the wrong layer of the hierarchy, I think. There are many open-source linear algebra libra
by singhrac 6y ago
> There’re vendor-agnostic equivalents like Eigen.
That's looking at the wrong layer of the hierarchy, I think. There are many open-source linear algebra libraries, but iirc they all link against something that has a BLAS/LAPACK API. That might be something like MKL, OpenBLAS, ATLAS, etc.
When I last checked, MKL was much faster than its competitors, and is only available (at full speed) on Intel CPUs. Has that changed?
- Const-me 6y ago> iirc they all link against something that has a BLAS/LAPACK API Eigen can consume these I think, but they are optional. It has it’s own implementation of these, written in manually vectorized C++, with intrinsics, up to and including AVX512 (controlled with macros). For parallelization it uses OpenMP provided by the compiler (also controlled with a macro). > Has that changed? It’s hard to directly compare Eigen to the rest of them. They don’t do the same thing. One feature of Eigen is lazy evaluation. Expressions like a+b or a×b don’t return another matrix or vector; they return a placeholder object that only computes something on assignment. For complicated expressions this can be a huge win, e.g. r=a+b+c+d will read from a,b,c,d, compute sum of the 4 on the fly, and write into r without temporary copies in memory. However, also makes Eigen’s source code outright scary, and hard to debug or optimize. Anyway, based on the old pics there http://eigen.tuxfamily.org/index.php?title=Benchmark http://eigen.tuxfamily.org/index.php?title=Benchmark they are more or less comparable. Things like alpha·X+beta·Y were much faster in Eigen (probably due to that lazy evaluation thing), Hessenberg was much faster in MKL, in general they are close.
- gnufx 6y ago> When I last checked, MKL was much faster than its competitors That has never been generally true in my experience measuring over the years. It has been true at times for specific cases, e.g. OpenBLAS until it got avx512 support on a par with MKL (at least for serial DGEMM -- I've forgotten quite how the rest of level 3 goes).