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

Ian Henriksen insertinterestingnamehere at gmail.com
Mon Jul 13 13:52:05 EDT 2015


On Mon, Jul 13, 2015 at 11:08 AM Nathaniel Smith <njs at pobox.com> wrote:

> I think that if you can make this work then it would be great (who doesn't
> like less code that does more?), but that as a practical matter
> accomplishing this may be difficult. AFAIK there simply is no way to write
> generic code to probe the system for "any BLAS", except by explicitly
> having a list of supported BLASes and checking for each in sequence. Given
> that new BLAS libraries appear at a rate of < 1/year, and that we already
> support most of the viable ones, the current approach is practically
> reasonable even if non-ideal in principle.
>
Agreed. From my experience, the existing BLAS and LAPACK implementations
are only mostly interchangeable. There may be some small differences
between the libraries that will need some special casing. On the other
hand, if you can get it to work properly, go for it. Some generalization
and simplification is probably possible.

> Keep in mind that any solution needs to support weird systems too,
> including Windows. I'm not sure we can assume that all BLAS libraries are
> ABI compatible either. Debian/Ubuntu make sure that this is true for the
> ones they ship, but not all systems are so carefully managed. For LAPACK in
> particular I'm pretty sure there are multiple ABIs in active use that scipy
> supports via code in numpy.distutils. (Hopefully someone with more
> expertise will speak up.)
>
Yes, there are ABI patches in SciPy that put together a uniform ABI for all
currently supported BLAS and LAPACK libraries (
https://github.com/scipy/scipy/tree/master/scipy/_build_utils). With a
little luck, some of these other libraries won't need as much special
casing, but, I don't know offhand.
-Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150713/e70543ea/attachment.html>


More information about the NumPy-Discussion mailing list