-
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
Disable numpy AVX512 when compiled with Intel classic #486
Conversation
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 |
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.
Should we create the spack develop PR based on these changes and see what the spack people and package maintainers have to say?
@climbfuji Sure, let's give that a try. I'll open it today. |
Closing. Will reopen a new PR that cherry-picks the fix that went into spack/spack. |
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