-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Set non-strict export as default mode #148790
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/148790
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 20b836f with merge base 924a247 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D70228628 |
This pull request was exported from Phabricator. Differential Revision: D70228628 |
2541e54
to
ae254d4
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
ae254d4
to
60c282b
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
60c282b
to
abfe3d0
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
abfe3d0
to
f486c12
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
f486c12
to
ad25c48
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
ad25c48
to
3bd3d27
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
3bd3d27
to
10db323
Compare
test/export/test_export_strict.py
Outdated
@@ -12,22 +12,22 @@ | |||
test_classes = {} | |||
|
|||
|
|||
def mocked_non_strict_export(*args, **kwargs): | |||
def mocked_strict_export(*args, **kwargs): | |||
# If user already specified strict, don't make it non-strict |
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.
# If user already specified strict, don't make it non-strict | |
# If user already specified strict, don't make it strict |
test/export/testing.py
Outdated
@@ -263,6 +263,12 @@ def expectedFailureNonStrict(fn): | |||
return fn | |||
|
|||
|
|||
# Controls tests generated in test/export/test_export_nonstrict.py |
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.
# Controls tests generated in test/export/test_export_nonstrict.py | |
# Controls tests generated in test/export/test_export_strict.py |
@@ -9933,6 +9934,7 @@ def forward(self, x): | |||
).run(ep.graph_module.code) | |||
|
|||
def test_replace_unbacked_with_very_large_upperbound(self): | |||
strict = True |
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.
why is this set to True?
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.
Because the un-modded (as in not a variant like retracability) test is not in non-strict mode, however some of the test cases like this one fails in non-strict. So I temporarily forced strict mode for them.
@@ -6720,7 +6722,6 @@ def forward(self): | |||
ep = export(m, ()) | |||
self.assertEqual(ep.graph_signature.lifted_tensor_constants, ["x"]) | |||
|
|||
@testing.expectedFailureRetraceability # T186979579 |
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.
Why does this error disappear now? Does this mean we should also have a variant that is Retraceability w/ Strict export?
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.
Ah, because of a bug in my code, I forgot to update the strict flag in retracing export call. Changed.
dbcb478
to
2ed3525
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
2ed3525
to
0606d0b
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
0606d0b
to
bc976c0
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
bc976c0
to
598895f
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
598895f
to
677ca92
Compare
This pull request was exported from Phabricator. Differential Revision: D70228628 |
677ca92
to
b9fe626
Compare
Summary: Pull Request resolved: pytorch#148790 - Flip the default value of strict argument in torch.export.export from True to False - Update test infra to cope with the change, some of them made the assumption of strict mode as default - Disabled some tests that fail in non-strict mode **If this diff breaks your test, please add `strict=True` to your torch.export.export callsite to mitigate**. DO NOT revert this diff. Test Plan: Sandcastle Reviewed By: angelayi Differential Revision: D70228628
This pull request was exported from Phabricator. Differential Revision: D70228628 |
b9fe626
to
20b836f
Compare
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
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 |
Summary:
Test Plan: Sandcastle
Differential Revision: D70228628
cc @ezyang @gchanan