BUG: always ignore FPE when Accelerate is the BLAS backend #30255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #30162 which seems to be a regression in Accelerate. It started happening when we moved to a newer macOS image in CI (not an M4 machine) and was independently reported by @neutrinoceros on macOS 15.7.1 with an M2 machine.
Continuation of #30102. Set the default
blas_supports_fpe=falsewhen compiling with Accelerate to "ignore all FPE in calls to BLAS". #30102 added a check when importing NumPy to see if a simple matmul triggers an FPE. If so, thenblas_supports_fpeis set tofalse. But since the check is flaky it does not reliably set the value tofalseand we see FPE warnings.Downstream packagers like conda that allow switching out the blas support from Accelerate to OpenBLAS to MKL and others will have to develop a patch to deal with the flaky Accelerate library and FPEs. The available handles are:
blas_supports_fpe=falseand never see the warnings, at the cost of not knowing when overflow/underflow/divide-by-zero occursnumpy._core._multiarray_umath._blas_supports_fpe(False)when Accelerate is swapped in, to work around the flaky FPE false-positives.