-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Fix vs2022 caused AVX512 illegal instruction issue. #153480
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153480
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 99978ab with merge base dccd19c ( NEW FAILURE - The following job has failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
LGTM. If it's desired, I'd suggest creating a GitHub issue to solve the root cause - removal of AVX512 intrinsic from code targeting AVX2 - and linking it to this PR.
Upgrade VS2022 to latest can fix this issue, but I don't known how, please check here: #145702 (comment) @Blackhex can you check with Visual studio team to seek a solution? |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
a6214c5
to
56e7d38
Compare
IMO, the https://github.com/pytorch/pytorch/blob/56e7d38b9f9ee727caf7b86aa0cca5088c94a489/.ci/pytorch/windows/internal/vc_install_helper.bat script is not used for PR builds that are done with https://github.com/pytorch/pytorch/blob/56e7d38b9f9ee727caf7b86aa0cca5088c94a489/.ci/pytorch/win-test-helpers/build_pytorch.bat script which probably assumes the build tools already installed on the image. If that's true, it should be updated on AMI image or installation added (https://github.com/Blackhex/pytorch-test-infra/blob/main/aws/ami/windows/scripts/Installers/Install-VS.ps1). The installation script should be used for nightly wheels builds. Can you confirm or decline whether the update of build tools work there? PS: I am discussing with VS team what is the reason that the issue is not happening with newer build tools. I will need a small C++ repro case for that which will take some time to dissect from the codebase, unless someone already did that? |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
56e7d38
to
cd0344d
Compare
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
ffa3a12
to
ad4ada3
Compare
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.
lgtm
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: xpu / linux-jammy-xpu-2025.1-py3.9 / test (default, 6, 6, linux.idc.xpu) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: xpu / linux-jammy-xpu-2025.1-py3.9 / test (default, 6, 6, linux.idc.xpu) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: pull / cuda12.4-py3.10-gcc9-sm75 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu), xpu / linux-jammy-xpu-2025.1-py3.9 / test (default, 6, 6, linux.idc.xpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
I couldn't find any documentation for d2implyavx512upperregs.... |
Yeah, this flag is undocumented. I found out this is a solution to the problem from public (and internal) discussions like https://developercommunity.visualstudio.com/t/Code-gen-bug-uses-ymm16-register-for-AVX/10564317 |
Fixes #145702
Add
/d2implyavx512upperregs-
to disable compiler over-aggressive optimization, which caused involeved AVX512 register on AVX2 machine.Reference to: #145702 (comment)
Local test passed:

cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168