[standalone_compile] Fix single Tensor outputs from split_module#157803
[standalone_compile] Fix single Tensor outputs from split_module#157803zou3519 wants to merge 2 commits intogh/zou3519/1186/basefrom
Conversation
We assumed that the output in an FX graph would always just be a list[Tensor], even in the single tensor return case. It is possible for the output to be a single Tensor. This can happen by calling torch.fx.split_module on the module. Test Plan: - new test [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157803
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 281ca0c with merge base 0f9c1b3 ( 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. |
…module" We assumed that the output in an FX graph would always just be a list[Tensor], even in the single tensor return case. It is possible for the output to be a single Tensor. This can happen by calling torch.fx.split_module on the module. Test Plan: - new test cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
We assumed that the output in an FX graph would always just be a list[Tensor], even in the single tensor return case. It is possible for the output to be a single Tensor. This can happen by calling torch.fx.split_module on the module. Test Plan: - new test ghstack-source-id: 679910a Pull Request resolved: #157803
oulgen
left a comment
There was a problem hiding this comment.
while i'm ok with this, should we not just fix split_module to always return a list?
this may be BC-breaking -- split_module has been a public API since 2021 and things (third-party implementations of pipeline parallelism and cudagraph splitting) use it |
|
@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 |
Stack from ghstack (oldest at bottom):
We assumed that the output in an FX graph would always just be a
list[Tensor], even in the single tensor return case.
It is possible for the output to be a single Tensor. This can happen
by calling torch.fx.split_module on the module.
Test Plan:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov