-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TensorIR][UX] Type annotation-based runtime type checking #9559
Conversation
Looks like we need at least python 3.7 to run the decorator… |
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 |
Alternatively, there are other metaprogramming tricks to completely avoid recursion and could potentially generate significantly better error message. |
Update with a py36 compatible implementation |
The error message is improved to:
|
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