You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/11/23 08:12:15 UTC
[GitHub] [tvm] junrushao1994 opened a new pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
junrushao1994 opened a new pull request #9559:
URL: https://github.com/apache/tvm/pull/9559
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:
```
ValueError: The loop no long exists in the IRModule
```
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen commented on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-976698449
on the c++ stacktrace side, perhaps the main thing is to update the trace formatter to simplify and skip some of the less informative traces(e.g. unpackcall_dispatcher) but keep the rest of the useful traces
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-976738622
> on the c++ stacktrace side, perhaps the main thing is to update the [trace normalizer](https://github.com/apache/tvm/blob/main/src/runtime/c_runtime_api.cc#L225) 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen commented on a change in pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#discussion_r755234523
##########
File path: src/tir/schedule/concrete_schedule.h
##########
@@ -204,7 +204,7 @@ inline StmtSRef ConcreteScheduleNode::GetSRef(const BlockRV& block_rv) const {
<< (obj.defined() ? obj->GetTypeKey() : "None");
}
if (sref->stmt == nullptr) {
- LOG(FATAL) << "ValueError: The StmtSRef has expired";
+ LOG(FATAL) << "ValueError: The block no long exists in the IRModule";
Review comment:
no longer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-976806920
Update with a py36 compatible implementation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen merged pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #9559:
URL: https://github.com/apache/tvm/pull/9559
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on a change in pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on a change in pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#discussion_r755256468
##########
File path: src/tir/schedule/concrete_schedule.h
##########
@@ -204,7 +204,7 @@ inline StmtSRef ConcreteScheduleNode::GetSRef(const BlockRV& block_rv) const {
<< (obj.defined() ? obj->GetTypeKey() : "None");
}
if (sref->stmt == nullptr) {
- LOG(FATAL) << "ValueError: The StmtSRef has expired";
+ LOG(FATAL) << "ValueError: The block no long exists in the IRModule";
Review comment:
Ooops typo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-977046104
The error message is improved to:
```
TypeError Traceback (most recent call last)
/tmp/ipykernel_307968/1279557970.py in <module>
5 i = sch.get_loops(block_c)
6 # Tile the loop nesting.
----> 7 i_0, i_1, i_2 = sch.split(i, factors=[None, 4, 4])
8 print(sch.mod.script())
~/Projects/tvm-dev/python/tvm/tir/schedule/_type_checker.py in wrap(*args, **kwargs)
147 )
148 if error_msg is not None:
--> 149 raise TypeError(error_msg)
150 return func(*args, **kwargs)
151
TypeError: In "Schedule.split", "loop" has wrong type. Expected "LoopRV", but gets: "list"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-976291799
Looks like we need at least python 3.7 to run the decorator…
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen edited a comment on pull request #9559: [TensorIR][UX] Type annotation-based runtime type checking
Posted by GitBox <gi...@apache.org>.
tqchen edited a comment on pull request #9559:
URL: https://github.com/apache/tvm/pull/9559#issuecomment-976698449
on the c++ stacktrace side, perhaps the main thing is to update the [trace normalizer](https://github.com/apache/tvm/blob/main/src/runtime/c_runtime_api.cc#L225) to simplify and skip some of the less informative traces(e.g. unpackcall_dispatcher) but keep the rest of the useful traces
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org