-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[easy] Run autograd if any mutations on inputs that require grad #128229
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/128229
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (2 Unrelated Failures)As of commit 3e8b9bb with merge base failed to retrieve merge base, please contact dev infra: FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
||
|
||
def skipIfDynamoInput(reason, xfail=False): | ||
def skipIfDynamoInput(reason): |
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.
My previous PR didn't actually test xfail properly here, it was just skipping them anyway. It turns out in python 3 you can't xfail tests from methods, only at the class level. So I implemented expected failure with xfail_inherited_tests instead.
@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 |
cc @IvanKobzarev / @tugsbayasgalan - another subtle AOTAutograd correctness issue that would be good to understand (also around properly picking inference vs. training) |
thanks for the fix! |
…orch#128229) If any inputs are mutated that require grad, even if all the outputs don't require grad, we should still run autograd with a backwards graph. This fixes two tests: test_input_mutation_alias_everything and test_view_detach. Fixes pytorch#128035 Pull Request resolved: pytorch#128229 Approved by: https://github.com/aorenste
Stack from ghstack (oldest at bottom):
If any inputs are mutated that require grad, even if all the outputs don't require grad, we should still run autograd with a backwards graph. This fixes two tests: test_input_mutation_alias_everything and test_view_detach.
Fixes #128035