You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
As per the linked issue in numpy, I wanted to raise and document the solution here (or link it to a TROUBLESHOOTING.md) for others trying to use the source code for this book.
BLAS stands for Basic Linear Algebra Subprograms. So all the core maths operations in numpy which actually make it fast, can lean on the platform specific implementations of BLAS.
Compiled programs supporting every combination of CPU architecture and OS platform and OS version is a disturbingly difficult task.
So numpy has allowed the OS to provide their own backend for BLAS to delegate this responsibility. What makes this harder is the addition of GPU accelerated versions of BLAS blows out these combinations which make it unwieldy for numpy to support on their own.
So on macOS though, the Accelerate Framework is meant to provide native BLAS support.
numpy being good citizens for the scientific community occasionally need to flag certain versions of these frameworks as bad builds as they produce incorrect results.
That is why we need to swap it out for an alternative in this situation. It isn't the end of the world, just a sharp edge to be aware of in this space.
Conclusion
Hopefully future versions of numpy and Accelarate play nice again and this is not an issue. For now this error will show up because during install, a calculation which is known to trigger the fault in these backends, will raise this error.
The text was updated successfully, but these errors were encountered:
Error Message:
As per the linked issue in
numpy
, I wanted to raise and document the solution here (or link it to a TROUBLESHOOTING.md) for others trying to use the source code for this book.numpy/numpy#15947
Current Behavior
This will spit errors in
scikit-image
andgensim
aboutbuggy Accelerate backend in numpy 1.19
.Possible Solution
There are two proposed solutions:
numpy==1.18.0
openblas
Combining both:
Updating the pinned version in
requirements.txt
tonumpy==1.18.0
also allows this option:Context
Why is this a problem?
BLAS
stands for Basic Linear Algebra Subprograms. So all the core maths operations innumpy
which actually make it fast, can lean on the platform specific implementations of BLAS.Compiled programs supporting every combination of CPU architecture and OS platform and OS version is a disturbingly difficult task.
So
numpy
has allowed the OS to provide their own backend for BLAS to delegate this responsibility. What makes this harder is the addition of GPU accelerated versions of BLAS blows out these combinations which make it unwieldy fornumpy
to support on their own.So on macOS though, the
Accelerate
Framework is meant to provide native BLAS support.numpy
being good citizens for the scientific community occasionally need to flag certain versions of these frameworks as bad builds as they produce incorrect results.That is why we need to swap it out for an alternative in this situation. It isn't the end of the world, just a sharp edge to be aware of in this space.
Conclusion
Hopefully future versions of
numpy
andAccelarate
play nice again and this is not an issue. For now this error will show up because during install, a calculation which is known to trigger the fault in these backends, will raise this error.The text was updated successfully, but these errors were encountered: