2.5 of Python Science and Technology Computational Distribution Anaconda has been released. According to DEVELOPER BLOG, MKL (Intel Math Kernel), which was previously provided as a paid version, Library) seems to be available in the free version as well.
I tried to see how fast it was. Prepare the OpenBLAS [^ 1] version and MKL version docker so far, and check with the smallest one of DigitalOcean. Saw.
[^ 1]: "conda install nomkl" will be the OpenBLAS version.
I timed the inverse matrix calculation of a 2000 × 2000 random matrix.
$ docker run -it --rm tsutomu7/scientific-python python -m timeit -c \
'import numpy as np; np.linalg.inv(np.random.rand(2000, 2000))'
10 loops, best of 3: 2.61 sec per loop
$ docker run -it --rm tsutomu7/scientific-python:mkl python -m timeit -c \
'import numpy as np; np.linalg.inv(np.random.rand(2000, 2000))'
10 loops, best of 3: 1.61 sec per loop
It seems to be about 40% faster.
By the way, 4 cores can be executed in parallel by default. It seems that it cannot be set beyond 4 cores.
python
import mkl
mkl.get_max_threads()
>>>
4
mkl.set_num_threads(1)
mkl.get_max_threads()
>>>
1
mkl.set_num_threads(8)
mkl.get_max_threads()
>>>
4
that's all