Why has matrix multiplication using python numpy got so slow after upgrading ubuntu from 12.04 to 14.04?

I used to have Ubuntu 12.04 and recently made a fresh install of Ubuntu 14.04. The work I'm working on includes multiplications of large matrices (~ 2000 X 2000), for which I use numpy. The problem that I am facing is that now the calculations go 10-15 times longer.

Moving from Ubuntu from 12.04 to 14.04 involves moving from Python 2.7.3 to 2.7.6 and from numpy 1.6.1 to 1.8.1. However, I think the problem may be related to the linear algebra libraries that numpy is associated with. Instead of libblas.so.3gf and liblapack.so.3gf, I can only find libblas.so.3 and liblapack. extension .3 .

I also installed libopenblas and libatlas:

$ sudo apt-get install libopenblas-base libatlas3-base

and tried them, but the slowdown has not changed. So my questions are:

  • What is the difference between packages with and without "gf"?
  • Perhaps this causes a slowdown in matrix multiplications?
  • If so, how can I get back to libblas.so.3gf and liblapack.so.3gf? They seem to be discontinued in Ubuntu 14.04.

Thank you so much!

+4
2

wim , , , numpy BLAS (, CBLAS, ATLAS).

, BLAS , ldd .

, numpy , apt-get:

~$ ldd /usr/lib/python2.7/dist-packages/numpy/core/_dotblas.so
        ...
        libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f01f0188000)
        ...

, numpy /usr/lib/libblas.so.3. CBLAS, .

, wim, numpy, apt-get, , pip, . , sudo pip install ... Python . , Python.

~/.local/ pip install --user ..., , virtualenv.

update-alternatives, numpy BLAS. , , .

+5

numpy ?

, pip, , .

  • apt (sudo apt-get purge python-numpy)
  • build-deps (sudo apt-get install libblas-dev liblapack-dev gfortran), , , , .
  • pip install numpy
+2

All Articles