Repository navigation
Conversation
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/121808
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c8afc4c with merge base 6b5259e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI ghstack-source-id: ea817c0 Pull Request resolved: #121808
|
@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 |
|
Good found! Way to go! |
Makes sense, I will add one. At the moment, this change is blocked due to a CI failure. On first sight it looks like this change triggered something (or CI is broken) |
|
the CI failure was just the CI being flaky, it looks like |
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Additional test in test_torchinductor_dynamic_shapes NOTE: The test might have uncovered another preexisting issue. This can be triggered by uncommenting a single line in the unit test. ghstack-source-id: 184c815 Pull Request resolved: #121808
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Additional test in test_torchinductor_dynamic_shapes NOTE: The test might have uncovered another preexisting issue. This can be triggered by uncommenting a single line in the unit test. ghstack-source-id: 184c815 Pull Request resolved: #121808
lezcano
left a comment
There was a problem hiding this comment.
This test is quite complex. Isn't it possible to test this function similar to what we do at
pytorch/test/inductor/test_torchinductor.py
Lines 8442 to 8459 in 4aaf25b
yes, that looks right and will likely execute much faster. I arrived at the test you see here after writing it in different ways - also looking at how tests were set up in test_torchinductor.py using the TritonCodeGenTests.NoOpCompilerBackend - but I was often hitting the ConstraintViolationError I mentioned above when constraining it to a static int in one way or another. So, to exclude the possibility that I was setting up the shape env in the wrong way for testing, I used the one that is actually created by the full logic of torch.compile with inductor backend. |
| torch._dynamo.reset() | ||
|
|
||
| _x = torch.randn([5, 3, 3]) | ||
| torch._dynamo.mark_dynamic(_x, 0) |
There was a problem hiding this comment.
Just use maybe_mark_dynamic here.
| return x.cos() | ||
| if x.shape[0] < 5: | ||
| return x * 2 | ||
| # x.shape[0] == 5 at this point |
There was a problem hiding this comment.
Funnily enough, this should also error out when using mark_dynamic. Mind filing an issue? cc @ezyang
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
Tried that ( see https://gist.github.com/kadeng/2544c6add99c8b55d9000ffe04e69974 ) but it didn't really work. The test variant I originally wrote, with maybe_mark_dynamic instead of mark_dynamic works nicely now, though. I'd leave it at that. |
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Additional test in test_torchinductor_dynamic_shapes NOTE: The test might have uncovered another preexisting issue. This can be triggered by uncommenting a single line in the unit test. ghstack-source-id: 1d97ac8 Pull Request resolved: #121808
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
…none" There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Additional test in test_torchinductor_dynamic_shapes NOTE: The test might have uncovered another preexisting issue. This can be triggered by uncommenting a single line in the unit test. ghstack-source-id: 7aaaa17 Pull Request resolved: #121808
[ghstack-poisoned]
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Additional test in test_torchinductor_dynamic_shapes NOTE: The test might have uncovered another preexisting issue. This can be triggered by uncommenting a single line in the unit test. ghstack-source-id: 07ebf1e Pull Request resolved: #121808
|
@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 |
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none, where the return value of a call to V.graph._shape_env._maybe_evaluate_static is being discarded. This fix changes that to work how it was likely intended to. Test Plan: CI Pull Request resolved: #121808 Approved by: https://github.com/lezcano, https://github.com/jansel, https://github.com/aakhundov
Stack from ghstack (oldest at bottom):
There's obviously a small typo in WrapperCodeGen.statically_known_int_or_none,
where the return value of a call to V.graph._shape_env._maybe_evaluate_static
is being discarded.
This fix changes that to work how it was likely intended to.
Test Plan:
CI
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @muchulee8 @aakhundov @ColinPeppler @amjames @desertfire @chauhang