Binaries without AVX512 kernels shouldn't report CPU Capability as AVX512 on machines with AVX512 support#66703
Closed
imaginary-person wants to merge 5 commits intopytorch:masterfrom
Closed
Binaries without AVX512 kernels shouldn't report CPU Capability as AVX512 on machines with AVX512 support#66703imaginary-person wants to merge 5 commits intopytorch:masterfrom
imaginary-person wants to merge 5 commits intopytorch:masterfrom
Conversation
PROBLEM: If a PyTorch release is built with a compiler that doesn't support all the AVX512 intrinsics in the codebase, then it won't have ATen AVX512 kernels, but at runtime, CPU capability would still be incorrectly returned as AVX512 on a machine that supports AVX512. It seems that PyTorch Linux releases are done on CentOS with gcc 7.3, so this bug would manifest in the 1.10 release, unless fixed. gcc versions below 9.0 don't support all the AVX512 intrinsics in the codebase, such as _mm512_set_epi16. SOLUTION: CPU Capability would be returned as AVX512 at runtime only if the binary was built with a compiler that supports all the AVX512 intrinsics in the codebase.
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slowFor more information, please take a look at the CI Flow Wiki. |
Contributor
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit fa5df1c (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
malfet
reviewed
Oct 15, 2021
If a machine without AVX2 support is used with the environment variable `ATEN_CPU_CAPABILITY=avx2`, then SIGILLs would happen without this check. Co-authored-by: Nikita Shulga <nikita.shulga@gmail.com>
If binaries are built with only default ATen CPU capability, then we won't call cpuinfo functions to query about AVX2 support .
Contributor
|
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
cpuinfo is not guaranteed to work correctly on newer versions of CPUs, and users should have the freedom to override faulty auto-detection, which may also be useful for debugging hardware emulators.
malfet
approved these changes
Oct 18, 2021
Contributor
|
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Contributor
This was referenced May 5, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BUG
If a PyTorch binary is built with a compiler that doesn't support all the AVX512 intrinsics in the codebase, then it won't have ATen AVX512 kernels, but at runtime, CPU capability would still be incorrectly returned as AVX512 on a machine that supports AVX512. It seems that PyTorch Linux releases are done on CentOS with
gcc 7.3, so this bug would manifest in the 1.10 release, unless a fix such as this one is added. gcc versions below 9.0 don't support all the AVX512 intrinsics in the codebase, such as_mm512_set_epi16.FIX
CPU Capability would be returned as AVX512 at runtime only if the binary was built with a compiler that supports all the AVX512 intrinsics in the codebase, and if the hardware the binary is being run on supports all the required AVX512 instruction sets.