PSA: MKL and AMD cpus

This is a PSA for those with AMD cpus. Intel’s math kernel library (MKL, the default on most conda distributions and numpy) does not use AVX2 on AMD CPUs. There is an undocumented flag in MKL that will “turn on” AMD AVX2, which can speed up some operations.

As an example, you can test this by adding the following one liner to your jupyter notebook:

!export MKL_DEBUG_CPU_TYPE=5

Donald Kinghorn has an excellent writeup here:

4 Likes