-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable numpy AVX512 when compiled with Intel classic #486
base: spack-stack-dev
Are you sure you want to change the base?
Disable numpy AVX512 when compiled with Intel classic #486
Conversation
@@ -482,6 +482,11 @@ def setup_build_environment(self, env): | |||
|
|||
env.set("NPY_LAPACK_ORDER", lapack) | |||
|
|||
def setup_run_environment(self, env): | |||
archs = ("x86_64_v4:", "cannonlake:", "mic_knl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the URLS of the github issues/discussions as hyperlinks above the archs =
line`, for example:
# https://linktomatplotlibissue
# https://linktonumpyissue
archs = ...
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
Per a comment from @seberg, I will try disabling the AVX512 features at build time. |
@seberg @climbfuji @AlexanderRichert-NOAA I tried adding this to the package.py with this patch. This produces the following lines at build time:
Indicating that AVX512 instructions are still being used. I have also tried this all lower case, but it still produces AVX512 instructions. What command should I use in the spack recipe to disable these? |
I'll have to look it up myself, let me pin @seiko2plus in case he sees it, he would know exactly immediately. |
Using NPY_DISABLE_CPU_FEATURES=AVX512F disables dynamic dispatch to these features, they still get build into NumPy library. But AVX512 code paths are never taken. Does that suffice in your case or do you not even want to build AVX512? |
"setup-args": {
"-Dcpu-dispatch": (
settings.get("setup-args", {}).get("-Dcpu-dispatch", "") +
"MAX -AVX512F -AVX512CD -AVX512_KNL -AVX512_KNM -AVX512_SKX -AVX512_CLX -AVX512_CNL -AVX512_ICL -AVX512_SPR"
)
} |
@r-devulap Yes, I think that would be sufficient (tested sufficiently at 26dd56f), though @seberg suggested that disabling the builds may be desirable. Since we would always be disabling the feature anyway, skipping the build may be desirable. @seiko2plus Thank you!! Adding |
This sets the environmental variable
NPY_DISABLE_CPU_FEATURES=AVX512F
to disableAVX512
features when thepy-numpy
module is loaded. TheAVX512
features produce undefined behavior when executing certainndarray
methods such asmin()
.Partly resolves JCSDA/spack-stack#1276 numpy/numpy#27840 matplotlib/matplotlib#28762