-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dynamo] Allow asserts to fail #126661
[dynamo] Allow asserts to fail #126661
Conversation
Currently if an assertion is statically known to be false, dynamo converts it to `_assert_async` which inductor currently ignores. Instead this graph breaks to raise the original assertion. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/126661
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5b077ba with merge base 5fb11cd (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Currently if an assertion is statically known to be false, dynamo converts it to `_assert_async` which inductor currently ignores. Instead this graph breaks to raise the original assertion. ghstack-source-id: f20717d8fa7be80257a614231e39371b92d2b20d Pull Request resolved: #126661
Currently if an assertion is statically known to be false, dynamo converts it to `_assert_async` which inductor currently ignores. Instead this graph breaks to raise the original assertion. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
Currently if an assertion is statically known to be false, dynamo converts it to `_assert_async` which inductor currently ignores. Instead this graph breaks to raise the original assertion. ghstack-source-id: 2bcbd9126a18e2078471f680d5e4b5a7eb2e90a7 Pull Request resolved: #126661
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this one. I think it should be:
- If we can prove that it's true or false, then act accordingly.
- Otherwise, process it as runtime assert
This way we can use asserts to add facts to our knowledge base (shape env).
cc @ezyang
That's what this does. If we statically know it's false then we graph break and let python raise the exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this LGTM, thanks @peterbell10
@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 |
uh, sorry, I had misread the code. I thought this was also handling the expression being equal to |
Stack from ghstack (oldest at bottom):
Currently if an assertion is statically known to be false, dynamo converts it to
_assert_async
which inductor currently ignores. Instead this graph breaks toraise the original assertion.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang