Repository navigation
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/98112
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: ✅ No FailuresAs of commit ba7cd40: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Test? |
|
i guess you removed review request so imma wait |
|
@ezyang, yea, adding test, will re-request when ready |
…re not invoked" Previously, we would run a forward graph whose backward we never invoked. This would prevent us from switching from warmup to recording. Instead, refine the heuristic to allow incrementing the generation as soon as we invoke a backward graph. This still handles the ``` mod1 = torch.compile(...) mod2 = torch.compile(...) mod2(mod1(x)).sum().backward() ``` case while accounting for graphs which we may not run backward of. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
…re not invoked" Previously, we would run a forward graph whose backward we never invoked. This would prevent us from switching from warmup to recording. Instead, refine the heuristic to allow incrementing the generation as soon as we invoke a backward graph. This still handles the ``` mod1 = torch.compile(...) mod2 = torch.compile(...) mod2(mod1(x)).sum().backward() ``` case while accounting for graphs which we may not run backward of. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
| and not is_inference | ||
| and not is_backward | ||
| ): | ||
| boxed_forward_device_index.set(next(iter(graph.device_idxs))) |
There was a problem hiding this comment.
Why is it correct to only take the first device index?
There was a problem hiding this comment.
we skip if there are multiple devices
…re not invoked" Previously, when we would run a forward graph whose backward we never invoked it would prevent us from switching from warmup to recording. Now, refine the heuristic to allow incrementing the generation as soon as we invoke a backward graph. This still handles the ``` mod1 = torch.compile(...) mod2 = torch.compile(...) mod2(mod1(x)).sum().backward() ``` case while accounting for graphs which we may not run backward of. It also now handles the case where we skip cudagraphify the backward of a forward. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
…re not invoked" Previously, when we would run a forward graph whose backward we never invoked it would prevent us from switching from warmup to recording. Now, refine the heuristic to allow incrementing the generation as soon as we invoke a backward graph. This still handles the ``` mod1 = torch.compile(...) mod2 = torch.compile(...) mod2(mod1(x)).sum().backward() ``` case while accounting for graphs which we may not run backward of. It also now handles the case where we skip cudagraphify the backward of a forward. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [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 merge |
|
The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot. |
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 |
ghstack-source-id: 063e036 Pull Request resolved: pytorch#98112
Stack from ghstack (oldest at bottom):
Previously, when we would run a forward graph whose backward we never invoked it would prevent us from switching from warmup to recording. Now, refine the heuristic to allow incrementing the generation as soon as we invoke a backward graph. This still handles the
case while accounting for graphs which we may not run backward of.
It also now handles the case where we skip cudagraphify the backward of a forward.
cc @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire