8

If numpy+mkl is faster, how much faster is it than numpy?

I found that the numpy+mkl installation package is much larger than numpy, but I can't feel the difference in their speed.

REA
  • 181
  • 1
  • 1
  • 14
  • The MKL version is compiled with support for Intel’s Math Kernel Library. This includes optimized routines for certain operations. You won’t likely observe the gains from this unless you’re really stressing your processor, performing operation that make use of those routines specifically. – TWReever Apr 24 '18 at 01:51
  • Are you testing the linear algebra routines? – juanpa.arrivillaga Apr 24 '18 at 01:52
  • @TWReever I use Intel's CPU on Windows 10, what computing operations can embody the advantages of mkl? – REA Apr 24 '18 at 01:57
  • @juanpa.arrivillaga I often use numpy for matrix operations and data format conversions – REA Apr 24 '18 at 01:59
  • @REA There’s a lot of documentation out there on the MKL, it’s hard to say without knowing exactly what you’re using Numpy for but chances are you’re taking advantage of it to some degree. – TWReever Apr 24 '18 at 02:39
  • Did we come to some conclusion for this question ? – Madhur Yadav Aug 02 '18 at 11:23

2 Answers2

5

numpy's standard pip packages are linked to OpenBLAS. Mabey OpenBLAS is in the same ballpark for speed as MKL. For a detailed comparison of their speeds, please see Boosting numpy: Why BLAS Matters and Benchmark OpenBLAS, Intel MKL vs ATLAS

TWReever
  • 357
  • 4
  • 14
REA
  • 181
  • 1
  • 1
  • 14
2

Short answer: No, maybe just slightly.

I just repeated now benchmark from this site: https://jwalton.info/Python-MKL-openBLAS/. And the results on current version of numpy are similar to those on intel-numpy.

Speedup > 1 means MKL is faster. Speedup < 0 means "standard" numpy (using openBLAS) is faster.

enter image description here enter image description here enter image description here enter image description here

As you can see, differences are small. For some functions there is small (~1.1x) speedup. But for most of them there is no speedup and one function is significantly slower in MKL.

dankal444
  • 3,172
  • 1
  • 23
  • 35