-
Notifications
You must be signed in to change notification settings - Fork 23.6k
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
Disallow skipping dynamo #109476
Disallow skipping dynamo #109476
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/109476
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 48f9c76 with merge base 6b7b9c7 ( 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. |
ghstack-source-id: f44d59d4f8b99e0e10778e64fa046e1ce910bed0 Pull Request resolved: #109476
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Differential Revision: [D49361915](https://our.internmc.facebook.com/intern/diff/D49361915) [ghstack-poisoned]
ghstack-source-id: bf93423a38db4818ff50b5eb039b56b02a148b1c Pull Request resolved: #109476
@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 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Based on William's recent diff on preserving node metadata on retracing, we no longer need to skip dynamo on retracing. This softens our previous restriction of not allowing any new constraints from user side because we can utilize dynamo to analyze through constraints now. As a result, re-export can technically happen with any new constraints. This opens up another problem that "Is it ok to use more loose constraints on the retracing?" If we allow loose constraints, we can technically diverge from eager behaviour because for example we could have eliminated unsafe control flow based on previous assumption. But we can also argue this is ok because we can say we treat the Exported callable to be an independent callable from its' original source code. We can technically ban loose constraints inside export, but my concern is we are breaking abstraction by doing special case checks on ExportedProgram. [ghstack-poisoned]
Successfully rebased |
ghstack-source-id: 8925de6987da6801f7d5cecccf30e24cd192aaaa Pull Request resolved: #109476
Based on William's recent diff on preserving node metadata on retracing, we no longer need to skip dynamo on retracing. This softens our previous restriction of not allowing any new constraints from user side because we can utilize dynamo to analyze through constraints now. As a result, re-export can technically happen with any new constraints. This opens up another problem that "Is it ok to use more loose constraints on the retracing?" If we allow loose constraints, we can technically diverge from eager behaviour because for example we could have eliminated unsafe control flow based on previous assumption. But we can also argue this is ok because we can say we treat the Exported callable to be an independent callable from its' original source code. We can technically ban loose constraints inside export, but my concern is we are breaking abstraction by doing special case checks on ExportedProgram. [ghstack-poisoned]
Based on William's recent diff on preserving node metadata on retracing, we no longer need to skip dynamo on retracing. This softens our previous restriction of not allowing any new constraints from user side because we can utilize dynamo to analyze through constraints now. As a result, re-export can technically happen with any new constraints. This opens up another problem that "Is it ok to use more loose constraints on the retracing?" If we allow loose constraints, we can technically diverge from eager behaviour because for example we could have eliminated unsafe control flow based on previous assumption. But we can also argue this is ok because we can say we treat the Exported callable to be an independent callable from its' original source code. We can technically ban loose constraints inside export, but my concern is we are breaking abstraction by doing special case checks on ExportedProgram. [ghstack-poisoned]
@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 |
@pytorchbot revert -m "Failing internal CI" -c ghfirst |
@pytorchbot successfully started a revert job. Check the current status here. |
@tugsbayasgalan your PR has been successfully reverted. |
This reverts commit 7bb1d10. Reverted #109476 on behalf of https://github.com/atalman due to Failing internal CI ([comment](#109476 (comment)))
Previous discussion: #109476 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
Previous discussion: #109476 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
Previous discussion: #109476 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
Previous discussion: #109476 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen [ghstack-poisoned]
Previous discussion: #109476 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng avikchaudhuri gmagogsfm zhxchen17 angelayi Xia-Weiwen Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) [ghstack-poisoned]
Previous discussion: #109476 In this PR, I made following additions to the original PR: 1) Unlifted graph module now runs the runtime assertions in its' forward call. 2) When we retrace, we make sure we run the assertions to make sure user is tracing the module with correct inputs with respect to the assumptions we made during first tracing. The way I do is that I create new graph module type with modified call method. And the runtime assertions happen under torchdynamo.disable so that it is just run in eager directly. The reason is we don't this to be traced part of the graph. 3) Both ep.module and capture_pre_autograd now returns _UnliftedGraphModule. Differential Revision: [D51078056](https://our.internmc.facebook.com/intern/diff/D51078056) Pull Request resolved: #110222 Approved by: https://github.com/zhxchen17
Stack from ghstack (oldest at bottom):
Based on William's recent diff on preserving node metadata on retracing, we no longer need to skip dynamo on retracing. This softens our previous restriction of not allowing any new constraints from user side because we can utilize dynamo to analyze through constraints now. As a result, re-export can technically happen with any new constraints. This opens up another problem that "Is it ok to use more loose constraints on the retracing?" If we allow loose constraints, we can technically diverge from eager behaviour because for example we could have eliminated unsafe control flow based on previous assumption. But we can also argue this is ok because we can say we treat the Exported callable to be an independent callable from its' original source code.
We can technically ban loose constraints inside export, but my concern is we are breaking abstraction by doing special case checks on ExportedProgram.