[TVMScript] Optionally output the address as part of variable names#15579
Merged
quic-sanirudh merged 2 commits intoapache:mainfrom Aug 21, 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 |
When debugging IRModule transformations, it can be useful to
know the exact C++ address of an object. For example, to determine
whether an undefined TIR variable was caused by erroneous insertion of
a new variable, or from failing to remove a previous variable. While
TVMScript does de-duplicate all names within a single print statement,
there isn't a convenient way to identify which variable in TVMScript
corresponds to a specific variable in C++ logging statements.
This commit adds `show_object_address` to the `PrinterConfig`. If
false (the default), no change is made to the TVMScript variable
names. If true, the address of the C++ object is appended to the
variable name. For example, printing a `tir.Var('my_name','int64')`
as `"my_name_0x1234abcd"`.
a9d3f42 to
3827ac1
Compare
The `private=True` branch is only on the unity branch.
quic-sanirudh
approved these changes
Aug 21, 2023
Hzfengsy
pushed a commit
to Hzfengsy/tvm
that referenced
this pull request
Sep 8, 2023
The new feature of printing object addresses is introduced in apache#15579. It's an excellent feature for debugging, but it should not be turned on by default.
junrushao
pushed a commit
to junrushao/tvm
that referenced
this pull request
Sep 10, 2023
…apache#15705) The new feature of printing object addresses is introduced in apache#15579. It's an excellent feature for debugging, but it should not be turned on by default.
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.
When debugging IRModule transformations, it can be useful to know the exact C++ address of an object. For example, to determine whether an undefined TIR variable was caused by erroneous insertion of a new variable, or from failing to remove a previous variable. While TVMScript does de-duplicate all names within a single print statement, there isn't a convenient way to identify which variable in TVMScript corresponds to a specific variable in C++ logging statements.
This commit adds
show_object_addressto thePrinterConfig. If false (the default), no change is made to the TVMScript variable names. If true, the address of the C++ object is appended to the variable name. For example, printing atir.Var('my_name','int64')as"my_name_0x1234abcd".