-
Notifications
You must be signed in to change notification settings - Fork 749
Added better error messages for type validators (stack trace) #7999
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
Added better error messages for type validators (stack trace) #7999
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7999
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 8 PendingAs of commit 777c710 with merge base 9bd18f6 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
swolchok
left a comment
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.
LGTM, thanks!
swolchok
left a comment
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 like this broke test_edge_dialect_fails in the linux unittest, please fix and ping me for re-review
|
@swolchok fixed the unit test (it now checks the contents of the first element of the new pair.) |
f3519e9 to
ad81488
Compare
ad81488 to
777c710
Compare
Summary
As I have been using executorch, I have run into issues with dtypes conflict during export, I end up with dtype mismatch during the to_edge process in exir. Unfortunately the current error message is less than clear, this change adds the stack trace from the nodes that have the issues, making it easier to find in your code where the type mismatch is.
Original Error Message:
New Error Message:
Changes:
Internally the validator is collecting the errors as they come up into a list, then later if that list is not empty an exception is made.
The only change is that during the collection process I also collect self.node, which happens to be the current node we are evaluating, and add that to the list (as the second item of a tuple). Then when raising the exception we have access to not just the op/args but also the node that was being evaluated.
Makes tracking these down much easier.
Test plan
No testing, aside from being able to use it to fix my problems, it should not have any issues.
self.node is already used to access the "meta" field, needed for the arg validation.