-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add optimal optimization flags for Intel compilers on AMD CPUs #3793
Comments
@Flamefire note that we set |
No I don't know. These are just the flags we use and one of our long-term admins said they are good. So: Magic! ;) |
@bartoldeman https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/code-generation-options/m.html#m lists |
it's even worse than that,
see also https://community.intel.com/t5/Intel-Fortran-Compiler/SSE-error-in-compilation-with-xHost-option-on-AMD-Zen-3-CPU/m-p/1287143 |
So #3797 would really help, I'd say. |
We have the following code for Intel toolchains:
However for AMD CPUs this is bad:
xHost
will use SSE only even when AVX2 is available. This then even fully fails installing software or installs it with worse optimizations.As we usually care about CPU vendor and vector instructions supported, I'd optionally add a third argument here: The max supported vector instruction set.
In EB, we then need to define a list of supported types, e.g. "avx2, avx, sse2, sse" in that order. If a tuple
(<arch>, <vendor>, <vector>)
is found in the dict that flag is used, otherwise the next lower vec is tried. If all were tried, the last entry is removed and the remaining is triedExtending this to the vendor part would allow this:
We should also allow to set this via env vars, similar to
EASYBUILD_OPTARCH
: Instead of conditionally setting it toEASYBUILD_OPTARCH="Intel:mavx2 -fma; GCC:march=native"
as we do on our site while having to check for AMD in the shell script we could do:EASYBUILD_OPTARCH="Intel,x86:xHost; Intel,x86,AMD,AVX2:mavx2 -fma; GCC:march=native"
This would allow some sort of future-proofing this.
For detecting the supported vector extensions we could use archspec or just use the cpu features query we already have and search for avx2 etc.
The text was updated successfully, but these errors were encountered: