-
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
[TVMScript] Migrate More to TVMScripr Printer #13785
[TVMScript] Migrate More to TVMScripr Printer #13785
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
3ab4d76
to
d02bcf3
Compare
4330d6f
to
1b13018
Compare
This PR gradually migrates more pieces of the default printing to TVMScript printer for TIR. This PR gradually migrates more pieces of the default printing to TVMScript printer for TIR. Details: - Introduced a method `AsLegacyRepr` which preserves existing `AsRepr` provided by `ReprPrinter`, so that the legacy behavior could be 100% preserved. - Introduced `Script` method to `IRModule`, `PrimFunc`, `tir.Stmt`, `tir.PrimExpr`. The `script` method exists in python side before, and this PR introduced them to C++ to be consistent. - Replace TIR's `PrettyPrint` to `operator <<` that is provided by the new `ReprPrinter`, which outputs in TVMScript format by default. `PrettyPrint` on Relay is all preserved for backward compatibility.
1b13018
to
a3fb7a8
Compare
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 for the migration. Just a few nits
@@ -69,6 +69,9 @@ class IRDocsifierFunctor { | |||
if ((pf = LookupDispatchTable("", type_index)) != nullptr) { | |||
return (*pf)(obj, args...); | |||
} | |||
LOG(WARNING) << "ObjectFunctor calls un-registered function on type: " | |||
<< runtime::Object::TypeIndex2Key(type_index) << " (token: " << token << ")" | |||
<< ". ObjectType: " << obj->GetTypeKey() << ". Object: " << obj; |
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.
Seems this warning is duplicate with the ICHECK(false)
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.
This is used to provide helpful debug information when there is outer logic that accidentally catches the error being thrown out
# tvm.testing.main() | ||
test_cache_read_specify_consumer() |
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.
Please revert this change :-)
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.
Oh ooops! Will do in a quick follow-up PR!
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.
Okay thanks
* [TVM] Update Submodule * [Compatible] apache/tvm#13785 * [Compatible] more apache/tvm#13785 Co-authored-by: SubmoduleUpdaterBot <[email protected]> Co-authored-by: Cody Yu <[email protected]>
This PR gradually migrates more pieces of the default printing to TVMScript printer for TIR. This PR gradually migrates more pieces of the default printing to TVMScript printer for TIR. Details: - Introduced a method `AsLegacyRepr` which preserves existing `AsRepr` provided by `ReprPrinter`, so that the legacy behavior could be 100% preserved. - Introduced `Script` method to `IRModule`, `PrimFunc`, `tir.Stmt`, `tir.PrimExpr`. The `script` method exists in python side before, and this PR introduced them to C++ to be consistent. - Replace TIR's `PrettyPrint` to `operator <<` that is provided by the new `ReprPrinter`, which outputs in TVMScript format by default. `PrettyPrint` on Relay is all preserved for backward compatibility.
This PR gradually migrates more pieces of the default printing to
TVMScript printer for TIR. Details:
AsLegacyRepr
which preserves existingAsRepr
provided byReprPrinter
, so that the legacy behaviorcould be 100% preserved.
Script
method toIRModule
,PrimFunc
,tir.Stmt
,tir.PrimExpr
. Thescript
method exists in python side before,and this PR introduced them to C++ to be consistent.
PrettyPrint
tooperator <<
that is provided bythe new
ReprPrinter
, which outputs in TVMScript format by default.PrettyPrint
on Relay is all preserved for backward compatibility.