Your message dated Thu, 26 Feb 2015 00:09:34 +0100
with message-id <[email protected]>
and subject line Re: [Python-modules-team] Bug#779243: numpy should use 
OpenBLAS, making it up to 150x faster
has caused the Debian Bug report #779243,
regarding numpy should use OpenBLAS, making it up to 150x faster
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
779243: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779243
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-numpy
Version: 1:1.8.2-2

(This problem report was written by Yaroslav Bulatov. I've confirmed it on
Debian
sid chroot. My computer gave a 30X improvement.)

Default numpy install uses inferior BLAS, and is very slow. Matrix
multiplication benchmark below gets me 1.26 G items/second with default
install on my Xeon 6-core 3.2 Ghz. When I install OpenBLAS, it goes up 186
G items/second. That's 150x improvement in speed which should be the
default for numpy.

benchmark
----
import time
import numpy as np
import numpy.random as random

size = 512
iters = 500
a = random.rand(size, size).astype(np.float32)
b = random.rand(size, size).astype(np.float32)
start_time = time.time()
for i in range(iters):
    np.dot(a, b)

end_time = time.time()
# size**3 multiplies, (size - 1) * size ** 2 adds
num_ops = size ** 3 + (size - 1) * size ** 2
print "Did %d multiplications of %d x %d matrices in %.1f seconds" %
(iters, size, size, end_time - start_time)
print "%.4f G items/sec" % (num_ops * float(iters) / (end_time -
start_time) / 10 ** 9)


fixing it with openblas:
-----
$ sudo apt-get install libopenblas-dev virtualenv python-dev
$ mkdir ~/tmp
$ cd ~/tmp
$ virtualenv env
$ source env/bin/activate
$ pip install numpy
$ which python
~/tmp/env/bin/python
$ python ...

--- End Message ---
--- Begin Message ---
On 25.02.2015 20:52, Jeff Breidenbach wrote:
> 
> Default numpy install uses inferior BLAS, and is very slow. Matrix
> multiplication benchmark below gets me 1.26 G items/second with default
> install on my Xeon 6-core 3.2 Ghz. When I install OpenBLAS, it goes up
> 186 G items/second. That's 150x improvement in speed which should be the
> default for numpy.


the numpy package can already use any blas available in debian,
including openblas:

sudo apt-get install libopenblas-base libatlas3-base
sudo update-alternatives --config libblas.so.3

using LD_PRELOAD=libofyourchoice also works.

But make sure to test your application well, especially openblas has a
very high bug density.

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to