[inductor][subgraph] Plumbing to get ShapeAsConstantBuffer from subgraph to main graph output#147559
[inductor][subgraph] Plumbing to get ShapeAsConstantBuffer from subgraph to main graph output#147559anijain2305 wants to merge 4 commits intogh/anijain2305/685/basefrom
Conversation
…aph to main graph output [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/147559
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit adb0901 with merge base 30375cb ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torch/_inductor/ir.py
Outdated
| except NotImplementedError: | ||
| pass | ||
| if isinstance(x, StorageBox): | ||
| if isinstance(x.data, ShapeAsConstantBuffer): |
There was a problem hiding this comment.
do you know why we're mapping ShapeAsConstantBuffer with StorageBox ? that seems weird
There was a problem hiding this comment.
It happens here. I can prevent wrapping of symints here. Is that more intuitive?
pytorch/torch/_inductor/lowering.py
Line 6779 in 2978771
…aph to main graph output ghstack-source-id: 543f908 Pull Request resolved: pytorch/pytorch#147559
… from subgraph to main graph output" I am unable to create a test case that fails without the next PR. The idea is to have a symint which is returned by the inner subgraph and then returned by the forward graph after partitioning. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
… from subgraph to main graph output" I am unable to create a test case that fails without the next PR. The idea is to have a symint which is returned by the inner subgraph and then returned by the forward graph after partitioning. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
… from subgraph to main graph output" I am unable to create a test case that fails without the next PR. The idea is to have a symint which is returned by the inner subgraph and then returned by the forward graph after partitioning. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
|
@eellison This should be ready now. |
| class TensorBox(MutableBox): | ||
| @staticmethod | ||
| def create(data): # type: ignore[no-untyped-def] | ||
| if isinstance(data, ShapeAsConstantBuffer): |
There was a problem hiding this comment.
do you know when we create these ? just curious
There was a problem hiding this comment.
I think in realize_input of ExternKernel. If that input happens to be output as well, then this PR is needed to make it work.
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: Lint / lintrunner-noclang / linux-job Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Pull Request resolved: #139325 Approved by: https://github.com/bdhirsh, https://github.com/zou3519 ghstack dependencies: #147559
Pull Request resolved: pytorch#139325 Approved by: https://github.com/bdhirsh, https://github.com/zou3519 ghstack dependencies: pytorch#147559
…aph to main graph output ghstack-source-id: 191c9ea Pull Request resolved: pytorch/pytorch#147559
Stack from ghstack (oldest at bottom):
I am unable to create a test case that fails without the next PR. The idea is to have a symint which is returned by the inner subgraph and then returned by the forward graph after partitioning.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov