News for hackers. Stuff that matters.
Re:GEMM: From Pure C to SSE Optimized Micro Kernels (2014) by stochastic_monk on Thursday March 15, 2018 @06:32PM (#16597051)
This is a great master class, if you will, on iterative optimization for core loops. They progressively make improvements to their method until they approach the performance of standard, optimized BLAS implementations. (About as fast as BLIS, less than Intel's MKL, which is about as fast as OpenBLAS. [0]) Timing Eigen without linking against BLAS is a little misleading, since Eigen is meant to be linked against a system BLAS.

You wouldn't want to use this code, but it shows you the sorts of things to start paying attention to in this performance-critical sections. I was most surprised by the fact that reordering operations to spread the same instructions apart made a significant difference.

(As an aside, your best bet in practical tools is using a metaprogramming library [Blaze seems to be the best], wrapping core operations in a fast BLAS implementation. I personally choose to use Blaze on top of OpenBLAS.)

[0] https://news.ycombinator.com/item?id=10114830

Re:GEMM: From Pure C to SSE Optimized Micro Kernels (2014) by gnufx on Friday March 16, 2018 @08:52AM (#16600273)
[Not all the world is C++ -- I'm glad to say!]

Note that OpenBLAS doesn't have avx512 kernels, and the fallback to avx2 (unreleased) is a factor of three slower than MKL dgemm on Knights Landing. It looks as if the next release of BLIS will remedy the lack of free BLAS avx512 support with micro-architecture dynamic dispatch which includes fairly competitive avx512 (>80% of MKL dgemm on KNL).

I don't know about the competition on non-x86 architectures, but BLIS currently has more limited support than OpenBLAS.

Re:GEMM: From Pure C to SSE Optimized Micro Kernels (2014) by stochastic_monk on Friday March 16, 2018 @11:51AM (#16601452)
Good to know! I wasn't aware. It doesn't matter too much for me, since the machines I'm using only support AVX2, but I do write my code to work generically on all vectorizations up to AVX512, and I'm likely to use MKL on Knights Landing+.
Re:GEMM: From Pure C to SSE Optimized Micro Kernels (2014) by doublerebel on Thursday March 15, 2018 @10:49PM (#16598209)
Very timely, I just spent the last two days getting Eigen, BLAS, Suitesparse, and Ceres playing nice together on Windows. I recognized the GEMM call from the Cmake module that checks for BLAS. Amazing the amount of work and optimization going into these libraries that underpin countless of today's leading ML and CV programs.