[invoke_subgraph] Support symint/int as inputs #140058
[invoke_subgraph] Support symint/int as inputs #140058anijain2305 wants to merge 5 commits intogh/anijain2305/582/basefrom
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140058
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4b0787a with merge base bf1b8ad ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| operands: Union[ | ||
| List[Union[torch.Tensor, torch.SymInt]], | ||
| Tuple[Union[torch.Tensor, torch.SymInt]], | ||
| List[Union[torch.Tensor, int]], |
There was a problem hiding this comment.
This is __call__ - not while tracing. So, symints would not be present here, they would be converted to ints.
There was a problem hiding this comment.
There could be cases where we're make_fx(symbolic=True) a function and if the subgraph takes a a shape from parent graph's input size (that would be a symbolic integer) i think.
something like:
def f(x: [s0, s1]):
def g(x, s: s0):
return x + s
return invoke_subgraph(g, x, (x, x.shape[0]))
make_fx(f, symbolic=True)(torch.randn(3, 3))
Dynamo tracing produce a hop call like:
invoke_subgraph(subgraph, (x, x.size(0)))make_fx(symbolic=True) then start to tracing the subgraph and going through the __call__ , that have a symbolic input.
Is it worth verifying? Probably not that useful since users might in general might not be make_fx the compiled artifacts any way. So stamp it any way.
There was a problem hiding this comment.
Yeah, I just got that. Adding symints here as well.
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [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 |
Pull Request resolved: pytorch#140058 Approved by: https://github.com/ydwu4, https://github.com/eellison ghstack dependencies: pytorch#139162
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov