[SciPy-Dev] Use vecLibFort instead of Accelerate?

Matthew Brett matthew.brett at gmail.com
Sat Oct 11 16:28:38 EDT 2014


Hi,

On Sat, Oct 11, 2014 at 1:07 PM, Sturla Molden <sturla.molden at gmail.com> wrote:
> Pauli Virtanen <pav at iki.fi> wrote:
>
>> Scipy (>= 0.14.0) should work OK with Accelerate out of the box.
>> vecLibFort etc. are not required.
>>
>> The same is true for Numpy as far as I know --- numpy.linalg does not
>> use the problematic parts of Accelerate Fortran ABI, and numpy.dot uses
>> the C-API.
>
> There is a bug in cblas_sgemv (and Fortran sgemv) that Apple does not seem
> to fix. It can produce segfaults under certain conditions. Having NumPy and
> Scipy crash randomly is not acceptable. We know how to work around it, but
> the question is should we, because the bug is clearly in Accelerate.

We have three main options here:

* Work round Accelerate bug;
* Use ATLAS;
* Use OpenBLAS.

It seems to me that the consensus is currently that OpenBLAS is not
reliable enough for us, but I'm happy to be corrected.

ATLAS has the problems I listed earlier, of which the main one is that
we can only optimize for the least common denominator machine.

So working round the Accelerate bug seems like the greatest gain for
the smallest pain - if the maintenance burden is acceptable.

Do I understand right that we have two options for this?

1) Pull in our own versions of the sgemv workaround in scipy;
2) Use vecLibFort to replace our own Accelerate wrappers.

Having the Accelerate wrappers and fixes go in one place seems like a
good idea in general, but I know nothing about the issues, I'm afraid.

Sturla - I saw you asking the author of vecLibFort about a cblas_sgemv
fix at [1] - would the plan be to use vecLibFort in numpy also?

Presumably we could do that via a git submodule?

Cheers,

Matthew


[1] https://github.com/numpy/numpy/issues/4007



More information about the SciPy-Dev mailing list