Skip to content

Instantly share code, notes, and snippets.

View zhangyuteng's full-sized avatar

Oren Pasquin zhangyuteng

View GitHub Profile
@cty-yyds
cty-yyds / AMD_mkl_results.md
Last active February 23, 2024 15:02 — forked from inoryy/_results.md
Fixing MKL on AMD Zen CPU.

Investigating MKL on AMD Zen CPU

As per discussion on Reddit, it seems a workaround for the Intel MKL's notorious SIMD throttling of AMD Zen CPUs is as simple a setting MKL_DEBUG_CPU_TYPE=5 environment variable. Intel removed the debug mode starting with MKL 2020.1 or newer. Although MKL 2020.1 and following appear to have improved performance by default on AMD to some extend.

Recommendation

For AMD Zen CPU, it is recommended to get MKL to speed-boost NumPy, SciPy, scikit-learn, and NumExpr even without using debug mode. You can have more speed boost using MKL_DEBUG_CPU_TYPE=5, but you need to downgrade the MKL to version 2020.0 or below.

For TensorFlow using AMD CPU, better to install origin version using pip install tensorflow rather than tensorflow-mkl.