[TVMScript] Migrate More to TVMScripr Printer#13785
Merged
tqchen merged 1 commit intoapache:mainfrom Jan 17, 2023
Merged
Conversation
Collaborator
|
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
MasterJH5574
approved these changes
Jan 17, 2023
Contributor
MasterJH5574
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the migration. Just a few nits
| } | ||
| LOG(WARNING) << "ObjectFunctor calls un-registered function on type: " | ||
| << runtime::Object::TypeIndex2Key(type_index) << " (token: " << token << ")" | ||
| << ". ObjectType: " << obj->GetTypeKey() << ". Object: " << obj; |
Contributor
There was a problem hiding this comment.
Seems this warning is duplicate with the ICHECK(false)
Member
Author
There was a problem hiding this comment.
This is used to provide helpful debug information when there is outer logic that accidentally catches the error being thrown out
Comment on lines
+888
to
+889
| # tvm.testing.main() | ||
| test_cache_read_specify_consumer() |
Contributor
There was a problem hiding this comment.
Please revert this change :-)
Member
Author
There was a problem hiding this comment.
Oh ooops! Will do in a quick follow-up PR!
comaniac
added a commit
to awslabs/raf
that referenced
this pull request
Jan 23, 2023
comaniac
added a commit
to awslabs/raf
that referenced
this pull request
Jan 23, 2023
comaniac
added a commit
to awslabs/raf
that referenced
this pull request
Jan 23, 2023
* [TVM] Update Submodule * [Compatible] apache/tvm#13785 * [Compatible] more apache/tvm#13785 Co-authored-by: SubmoduleUpdaterBot <submodule-updater-bot@users.noreply.github.com> Co-authored-by: Cody Yu <comaniac0422@gmail.com>
fzi-peccia
pushed a commit
to fzi-peccia/tvm
that referenced
this pull request
Mar 27, 2023
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.
1 task
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.
This PR gradually migrates more pieces of the default printing to
TVMScript printer for TIR. Details:
AsLegacyReprwhich preserves existingAsReprprovided byReprPrinter, so that the legacy behaviorcould be 100% preserved.
Scriptmethod toIRModule,PrimFunc,tir.Stmt,tir.PrimExpr. Thescriptmethod exists in python side before,and this PR introduced them to C++ to be consistent.
PrettyPrinttooperator <<that is provided bythe new
ReprPrinter, which outputs in TVMScript format by default.PrettyPrinton Relay is all preserved for backward compatibility.