-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[TensorExpr] Add IRVerifier. #52901
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
[TensorExpr] Add IRVerifier. #52901
Conversation
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. [ghstack-poisoned]
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. ghstack-source-id: fca2186 Pull Request resolved: #52901
💊 CI failures summary and remediationsAs of commit 85d3df6 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
Codecov Report
@@ Coverage Diff @@
## gh/ZolotukhinM/409/base #52901 +/- ##
===========================================================
- Coverage 78.01% 78.01% -0.01%
===========================================================
Files 1848 1849 +1
Lines 179696 179778 +82
===========================================================
+ Hits 140198 140255 +57
- Misses 39498 39523 +25 |
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.
Looks much better now. Thanks for moving them all together. It will be very useful to run this verifier pass wherever we need it.
How about explicit unit tests for the verifier? If that is going to be a lot of work, we can do that later.
throw unsupported_dtype(); | ||
} | ||
if (t->dtype() != f->dtype()) { | ||
if (t.dtype() != f.dtype()) { | ||
throw malformed_input("Bad dtype in IfThenElse"); | ||
} |
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.
These have already been moved to the verifier, right? Why do we need them here as well?
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 kept them in ::make
methods whenever it was possible, since there they don't cause segfaults and will allow to catch the issue earlier.
Yeah, absolutely agree. In future we might have different verifiers as well (e.g. one that would check that all buffers has
They might be useful, let me add some. |
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. Differential Revision: [D26682928](https://our.internmc.facebook.com/intern/diff/D26682928) [ghstack-poisoned]
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the way our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. ghstack-source-id: 755b513 Pull Request resolved: #52901
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. Differential Revision: [D26682928](https://our.internmc.facebook.com/intern/diff/D26682928) [ghstack-poisoned]
This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the way our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes #52778. ghstack-source-id: 8c99301 Pull Request resolved: #52901
@ZolotukhinM merged this pull request in e22da0a. |
Summary: Pull Request resolved: pytorch#52901 This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes pytorch#52778. Test Plan: Imported from OSS Reviewed By: navahgar Differential Revision: D26682928 Pulled By: ZolotukhinM fbshipit-source-id: c56524015cdffb1ed8bce4394509961a4071dcfa
Summary: Pull Request resolved: pytorch#52901 This PR implements IR Verifier and adds a call to it in `LoopNest` constructors. Checks that were in expr/stmt constructors before are now moved to the corresponding `::make` functions or to the verifier. They didn't really help from the constructors anyway since an exception thrown from there led to a segfault due to the fact our memory management works (object was not fully created but was registered in the kernel arena for destruction anyway). Fixes pytorch#52778. Test Plan: Imported from OSS Reviewed By: navahgar Differential Revision: D26682928 Pulled By: ZolotukhinM fbshipit-source-id: c56524015cdffb1ed8bce4394509961a4071dcfa
Stack from ghstack:
This PR implements IR Verifier and adds a call to it in
LoopNest
constructors. Checks that were in expr/stmt constructors before are now
moved to the corresponding
::make
functions or to the verifier. Theydidn't really help from the constructors anyway since an exception
thrown from there led to a segfault due to the fact our memory
management works (object was not fully created but was registered in the
kernel arena for destruction anyway).
Fixes #52778.
Differential Revision: D26682928