Building numpy with OpenBLAS
Hi. I'm trying to build numpy (1.6.2 and master from git) with OpenBLAS on Ubuntu server 11.10. I succeed with this just once and performance boost was really big for me, but unfortunately something went wrong with my application and I had to reinstall numpy. After that I couldn't reproduce this result and even just perform faster than default numpy installation with no external libraries anyhow. Now things went even worse. I assume that numpy built with BLAS and LAPACK should do dot operation faster than "clean" installation on relatively large matirces (say 2000 x 2000). Here I don't use OpenBLAS anyway. I install libblas-dev and liblapack-dev by apt-get and after that build numpy from sources / by pip (that doesn't matter for the result). Building tool reports that BLAS and LAPACK are detected on my system, so says "numpy.distutils.system_info" after installation. But matrix multiplication by dot takes the same time as clean installation (12 s vs 0.16 s with OpenBLAS). That's the first thing I'm wondering about. Nevertheless I tried to compile numpy with OpenBLAS only. I have forced this by setting ATLAS="" BLAS=/usr/lib/libopenblas.a LAPACK=/usr/lib/libopenblas.a as I saw somewhere in the internet. I had installed numpy exactly this way at the first time when I was lucky. But now it doesn't work for me. I tryied installing OpenBLAS from sources and as libopenblas-dev ubuntu package. So how can I fix this? Many thanks in advance.
On 14.12.2012 10:17, Sergey Bartunov wrote:
Now things went even worse. I assume that numpy built with BLAS and LAPACK should do dot operation faster than "clean" installation on relatively large matirces (say 2000 x 2000). Here I don't use OpenBLAS anyway.
No, _dotblas is only built against ATLAS, MKL or Apple's accelerate framework. So with OpenBLAS you have to call e.g. DGEMM from OpenBLAS yourself instead of using np.dot.
So how can I fix this? Many thanks in advance.
You might fix NumPy to build _dotblas against OpenBLAS as well :) Sturla
Hi Sergey: I recently ran into similar problems with ACML. See an original bug report (https://github.com/numpy/numpy/issues/2728) & documentation fix (https://github.com/numpy/numpy/pull/2809). Personally, I ended up using a patch similar to https://github.com/numpy/numpy/pull/2751 to force NumPy to respect site.cfg (so that I could put the libacml in the [blas_opt] & [lapack_opt] sections). But this seems unlikely to get merged into NumPy as it changes the behavior of site.cfg. Instead I think we should discuss adding a "have cblas" flag of some sort to the [blas] section so that the user can still get _dotblas to compile. -Brad On Friday, December 14, 2012 at 1:17 AM, Sergey Bartunov wrote:
Hi. I'm trying to build numpy (1.6.2 and master from git) with OpenBLAS on Ubuntu server 11.10.
I succeed with this just once and performance boost was really big for me, but unfortunately something went wrong with my application and I had to reinstall numpy. After that I couldn't reproduce this result and even just perform faster than default numpy installation with no external libraries anyhow.
Now things went even worse. I assume that numpy built with BLAS and LAPACK should do dot operation faster than "clean" installation on relatively large matirces (say 2000 x 2000). Here I don't use OpenBLAS anyway.
I install libblas-dev and liblapack-dev by apt-get and after that build numpy from sources / by pip (that doesn't matter for the result). Building tool reports that BLAS and LAPACK are detected on my system, so says "numpy.distutils.system_info" after installation. But matrix multiplication by dot takes the same time as clean installation (12 s vs 0.16 s with OpenBLAS). That's the first thing I'm wondering about.
Nevertheless I tried to compile numpy with OpenBLAS only. I have forced this by setting ATLAS="" BLAS=/usr/lib/libopenblas.a LAPACK=/usr/lib/libopenblas.a as I saw somewhere in the internet. I had installed numpy exactly this way at the first time when I was lucky. But now it doesn't work for me. I tryied installing OpenBLAS from sources and as libopenblas-dev ubuntu package.
So how can I fix this? Many thanks in advance. _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org (mailto:NumPy-Discussion@scipy.org) http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
Bradley M. Froehle
-
Sergey Bartunov
-
Sturla Molden