BLD: Add NPY_DISABLE_SVML env var to opt out of SVML #20842
Merged
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.
Backport of #20695.
SVML uses AVX-512 extensions that are only supported on sufficiently new Intel CPUs. Hard-requiring this vendored library for all x86_64 Linux platforms is not appropriate. When I build on an AMD Zen 2 CPU, I get errors to the effect of
when trying to import numpy. Furthermore, the simple platform check thwarts cross-compilation because it is the host, rather than the target, that is checked.
This patch adds recogniton for
NPY_DISABLE_SVML=1
in the environment, which will Numpy to build without the vendored SVML library. It might also be desirable to make the default-on behavior a little more nuanced than simply looking for Linux x86_64. However, I dont' have any specific ideas about the circumstances under which it should be enabled by default.