[Numpy-discussion] Numpy, BLAS, and CBLAS questions

Nathaniel Smith njs at pobox.com
Mon Jul 13 09:54:50 EDT 2015

On Jul 13, 2015 1:44 AM, "Eric Martin" <eric at ericmart.in> wrote:
> My procedure questions:
> Is the installation procedure I outlined above reasonable, or does it
contain steps that could/should be removed? Having to edit Numpy source
seems sketchy to me. I largely came up with this procedure by looking up
tutorials online and by trial and error. I don't want to write
documentation that encourages people to do something in a non-optimal way,
so if there is a better way to do this, please let me know.

I'll leave others with more knowledge to answer your other questions, but
if you're interested in making it easy for others to link numpy against
these libraries, I'd suggest modifying the numpy source further, by
submitting a patch that teaches numpy.distutils how to detect and link
against these libraries automatically :-). There are several libraries we
already know how to do this for that you can compare against for reference,
and this will also help for other libraries that use blas and
numpy.distutils, like scipy.

> Eigen has excellent performance. On my i5-5200U (Broadwell) CPU, I  found
Eigen BLAS compiled with AVX and FMA instructions to take 3.93s to multiply
2 4000x4000 double matrices with a single thread, while my install of Numpy
from ubuntu took 9s (and used 4 threads on my 2 cores). My Ubuntu numpy
appears to built against "libblas", which I think is the reference

If you're using the numpy packages distributed by Ubuntu, then it should be
possible to switch to openblas just by apt installing openblas and then
maybe fiddling with update-alternatives.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150713/b5f983e0/attachment.html>

More information about the NumPy-Discussion mailing list