[TensorIR][UX] Type annotation-based runtime type checking - #9559
Merged
Conversation
junrushao
requested review from
Hzfengsy,
ZihengJiang,
kparzysz-quic,
masahi,
tqchen and
vinx13
as code owners
November 23, 2021 08:12
Hzfengsy
approved these changes
Nov 23, 2021
Member
Author
|
Looks like we need at least python 3.7 to run the decorator… |
Member
|
on the c++ stacktrace side, perhaps the main thing is to update the trace normalizer to simplify and skip some of the less informative traces(e.g. unpackcall_dispatcher) but keep the rest of the useful traces |
tqchen
reviewed
Nov 23, 2021
Member
Author
Alternatively, there are other metaprogramming tricks to completely avoid recursion and could potentially generate significantly better error message. |
Member
Author
|
Update with a py36 compatible implementation |
Member
Author
|
The error message is improved to: |
tqchen
approved these changes
Nov 23, 2021
dchauhan-arm
pushed a commit
to dchauhan-arm/tvm
that referenced
this pull request
Nov 29, 2021
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Dec 1, 2021
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Dec 1, 2021
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 11, 2022
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressed the UX issue raised in #9551.
To address the first issue (cryptic error message on packed function boundary), this PR introduced a decorator @type_checked to do runtime type checking and generate more user-friendly error messages. In our example:
The second issue is mainly wording. This PR rephrasing the error message to:
However, I cannot find any environment variable to disable stacktrace printing. It was there months ago but no longer exists...Weird...
The notebook: https://gist.github.com/junrushao1994/cd0a33dc966da3b3f1abfa50a14e6d2c
CC: @tqchen