Repository navigation
Add no-tree-loop-optimize pragma for apply_grad_input on GCC/AArch64 - #182034
robert-hardwick wants to merge 4 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182034
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit e095ecd with merge base 11261ac ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Oh. THIS IS WHY enabling LTO fixed this bug, it was making it decide not to vectorize it. Interesting... |
| return; | ||
| } | ||
|
|
||
| // Avoid GCC AArch64 tree-vectorization issues when adding float buffers to BFloat16/Half gradients. |
There was a problem hiding this comment.
Is this still still a bug on GCC15? We are about to update GCC from 13 to 15 for AARCH anyway. #182016
There was a problem hiding this comment.
I was going to do this next, it's better to scope it to specific GCC versions if possible. I should probably have set this as draft until that's done, but i'll leave it open.
There was a problem hiding this comment.
I believe it should be fixed on GCC15 since the test starts failing with "Unexpected success": https://hud.pytorch.org/pr/pytorch/pytorch/182016?sha=0db4157a23bc48738c683bfcfe82636889055019#73782829252
There was a problem hiding this comment.
I've tested this on 13, 14 and 15 and looks like it has been fixed in 14 and 15 so i've updated the pragma to a tighter scope.
|
I seem to have included some other commits in here, marking as draft until i've fixed that |
OK fixed it now. We should have the correct pragma change scoped to only affect GCC < 14. |
This commits temporarily skips tests fixed by pytorch#182034 and pytorch#183697
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
Summary
Fixes an AArch64 GCC optimization issue in CPU upsample backward for reduced-precision gradients.
The reduced-precision
apply_grad_inputpath accumulates a temporary float buffer into BFloat16/Half gradients. On AArch64 GCC builds, tree vectorization of this function can produce incorrect results or illegal instructions. This change disables GCC tree vectorization only around that overload, while preserving the explicit PyTorch Vectorized<> implementation inside the function.The ARM64 xfail for TestNN.test_upsampling_bfloat16 is removed because the test now passes with this guard.
Stack from ghstack (oldest at bottom):
Fixes #177250