Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Numpy and Numpy-MKL?

I wanted to test some signal processing and statistics using SciPy. So I had to use scipy.signal and scipy.stats, but I always used to get an error:

ImportError: DLL load failed: The specified module could not be found.

I was using Numpy 1.7.1, scipy 0.12 and Python 2.7.3. I checked on the internet and asked about it on other forums too! This problem got solved when switched my Numpy distribution with the Numpy-MKL distribution.

I want to know the difference between the two libraries ?

like image 849
Animesh Pandey Avatar asked Jul 07 '13 14:07

Animesh Pandey


People also ask

Is NumPy using MKL?

NumPy doesn't depend on any other Python packages, however, it does depend on an accelerated linear algebra library - typically Intel MKL or OpenBLAS.

What is MKL Python?

The Intel Math Kernel Library (MKL) is a cross-platform framework that contains highly optimized math routines for common computations such as vector mathematics, linear algebra, statistics, and Fourier transformations. Other software packages can utilize this library to provide efficient and optimized computations.

Is MKL faster?

MKL 2022 is essentially the fastest in all three benchmarks—with a particularly noticable lead in eigenvalue computation—while OpenBLAS is barely competitive with MKL 2019. The importance of the Intel CPU workaround is very apparent, without which MKL would be slower than OpenBLAS when run on AMD CPUs.

How do I know if NumPy is using BLAS?

According to the answers to this stackoverflow question the only way to check if Numpy is using the system BLAS/LAPACK is to inspect the output of ldd on some library belonging to numpy hidden deep in the filesystem.


1 Answers

Numpy and scipy rely on lower level fortran libraries such as BLAS and lapack to perform many of their functions. These libraries come in many different versions, including the highly portable ones available from netlib, and other which are optimised for particular systems. In particular, Intel has one called "MKL" - Intel Math Kernel Library. So numpy-mkl just means a version of numpy compiled against the MKL fortran library.

Probably whichever version of numpy you previously had installed was somehow broken, and couldn't find the libraries it needed.

like image 118
DaveP Avatar answered Sep 30 '22 14:09

DaveP