-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Relax constraints for creating a GenericContextWrappingVariable
#129091
Relax constraints for creating a GenericContextWrappingVariable
#129091
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/129091
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 66a1370 with merge base 316c0d3 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
ghstack-source-id: 64ba666252c387d1507a4fab81126c7d9d5a7c65 Pull Request resolved: #129091
self.assertEqual(cnts.frame_count, 1) | ||
self.assertEqual(cnts.op_count, 6) |
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.
Can we turn on fullgraph=True on line 877?
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.
left one comment, otherwise, looks good!
…torch#129091) Pull Request resolved: pytorch#129091 Approved by: https://github.com/yanboliang, https://github.com/zou3519
…self.kw_names (pytorch#130490) Pull Request resolved: pytorch#130490 Approved by: https://github.com/williamwen42, https://github.com/zou3519 ghstack dependencies: pytorch#129091
…nges to self.kw_names (pytorch#130490)" This reverts commit a8bd293. Reverted pytorch#130490 on behalf of https://github.com/clee2000 due to test_jit started failing on main after this stack https://github.com/pytorch/pytorch/actions/runs/9980754603/job/27583474357 https://hud.pytorch.org/pytorch/pytorch/commit/a8bd2933d9eaf24ec9582001efa844de499d9e93 ([comment](pytorch#129091 (comment)))
…ble` (pytorch#129091)" This reverts commit 882fd91. Reverted pytorch#129091 on behalf of https://github.com/clee2000 due to test_jit started failing on main after this stack https://github.com/pytorch/pytorch/actions/runs/9980754603/job/27583474357 https://hud.pytorch.org/pytorch/pytorch/commit/a8bd2933d9eaf24ec9582001efa844de499d9e93 ([comment](pytorch#129091 (comment)))
and self.value.__new__ == object.__new__ | ||
and SideEffects.cls_supports_mutation_side_effects(self.value) | ||
and self.source is not None |
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.
@zou3519, with these changes, some contexts managers from pytest/unittest are now reaching this elif statement, rather than becoming a graph break. The problematic ones are failing because they check if the test raises a specific exception (assert_raises
, assertRaisesRegexHighlighted
) but dynamo changes the exception.
With that said, I had to add more than 100 files to dynamo_expected_failure
folder. Would it be ok if I just ignore those context managers?
elif (
issubclass(type(self.value), type)
and hasattr(
self.value, "__enter__"
) # TODO(voz): These can invoke user code!
and hasattr(
self.value, "__exit__"
) # TODO(voz): These can invoke user code!
and self.value.__new__ == object.__new__
and SideEffects.cls_supports_mutation_side_effects(self.value)
and self.source is not None
and self.value not in (assert_raises, assertRaisesRegexHighlight) # <----- this
):
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 motivation for this change is as while dynamo cannot handle those context managers, the test might be composed of other compilable code that has value. Adding the test to dynamo_expected_failure
may hide bugs that we don't catch because the test will be ignored.
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.
@yanboliang is there a way to mark a single API from e.g. pytest as skipped?
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.
NB: I'm fine with this, we just need to skip 3 decorators here
…torch#129091) Pull Request resolved: pytorch#129091 Approved by: https://github.com/yanboliang, https://github.com/zou3519
…self.kw_names (pytorch#130490) Pull Request resolved: pytorch#130490 Approved by: https://github.com/williamwen42, https://github.com/zou3519 ghstack dependencies: pytorch#129091
…nges to self.kw_names (pytorch#130490)" This reverts commit a8bd293. Reverted pytorch#130490 on behalf of https://github.com/clee2000 due to test_jit started failing on main after this stack https://github.com/pytorch/pytorch/actions/runs/9980754603/job/27583474357 https://hud.pytorch.org/pytorch/pytorch/commit/a8bd2933d9eaf24ec9582001efa844de499d9e93 ([comment](pytorch#129091 (comment)))
…ble` (pytorch#129091)" This reverts commit 882fd91. Reverted pytorch#129091 on behalf of https://github.com/clee2000 due to test_jit started failing on main after this stack https://github.com/pytorch/pytorch/actions/runs/9980754603/job/27583474357 https://hud.pytorch.org/pytorch/pytorch/commit/a8bd2933d9eaf24ec9582001efa844de499d9e93 ([comment](pytorch#129091 (comment)))
…self.kw_names (#130490) Pull Request resolved: #130490 Approved by: https://github.com/williamwen42, https://github.com/zou3519 ghstack dependencies: #129091
Pull Request resolved: #128646 Approved by: https://github.com/zou3519 ghstack dependencies: #129091, #130490
Stack from ghstack (oldest at bottom):
GenericContextWrappingVariable
#129091cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames