2

I have a new Ryzen CPU and ran into this issue. Eg. default anaconda channel uses Intel MKL and this cripples performance on Ryzen systems. If a numpy version using openblas is used, then it's much faster. The above example is in ubuntu but I need to achieve this in windows as well.

To be more specific I actually managed to install numpy with openblas but as soon I try to install anything on top like scikit-learn it will "downgrade" to mkl again.

What I'm looking for is install instructions for a "SciPy stack" python environment on windows using openblas?

EDIT:

This issue seems to be extremely annoying. While there is since not very long a nomkl package also for windows it doesn't seem to take as it always installs mkl version regardless. Even if I install from pip, conda will just overwrite it, with an mkl version again next time you install something, in my case another lib which requires conda.

EDIT2:

As far as I can tell for now the only "solution" is to install anything SciPy related from pypi (pip): numpy, SciPy, pandas, scikit-learn possibly more. eg. only really a solution if you really need anaconda for a specific package, which I do.

EDIT3:

So the MKL_DEBUG_CPU_TYPE=5 trick indeed works. Performance with mkl is restored and a bit better than with openblas. I did a very basic test (see the link above) with a fixed seed and the result is the same for mkl and openblas.

AstroTeen
  • 191
  • 4
  • 12
beginner_
  • 7,230
  • 18
  • 70
  • 127
  • I did find that but seem unmaintained and hence not sure it has an upgrade path. – beginner_ Nov 11 '19 at 18:18
  • 2
    This is a easy workaround for all MKL related problems (Matlab Numpy Scipy and many more) https://www.reddit.com/r/matlab/comments/dxn38s/howto_force_matlab_to_use_a_fast_codepath_on_amd/ – max9111 Nov 18 '19 at 19:26
  • @max9111 thanks! I will try this out on my ryzen system once I get the chance. This would help a lot. The only other option is to either use conda-forge (but scipy still needs to come from pip) or not use conda at all or switch to Linux. – beginner_ Nov 19 '19 at 05:10
  • Does anyone know if this problem shows up with R and Ryzen CPUs? – Erik Ruzek Apr 29 '20 at 13:57
  • @ErikRuzek If you use a R Version with MKL (Intel Math Kernel Library) yes. – max9111 Jul 01 '20 at 07:31
  • What about if you use the generic base R version from CRAN? Does that use MKL? My impression is no, but it also seems like you can get even better performance on Ryzen by using OpenBLAS (e.g., https://github.com/cvanpay/R_OpenBLAS_Zen) – Erik Ruzek Jul 01 '20 at 15:52

0 Answers0