[Docs] Add TVMScript architecture documentation#19398
Merged
MasterJH5574 merged 1 commit intoapache:mainfrom Apr 13, 2026
Merged
[Docs] Add TVMScript architecture documentation#19398MasterJH5574 merged 1 commit intoapache:mainfrom
MasterJH5574 merged 1 commit intoapache:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a detailed architectural overview of TVMScript, including its parser, IR builder, and printer systems, along with syntax references for TIR and Relax. The review feedback suggests improving the documentation by correcting the R.call_dps_packed signature and standardizing the naming of TIR control flow constructs for better consistency.
|
|
||
| - ``R.call_tir(func, args, out_sinfo)`` — call a TIR function | ||
| - ``R.call_packed(name, *args)`` — call a PackedFunc | ||
| - ``R.call_dps_packed(func, *args)`` — call using destination-passing style |
Contributor
There was a problem hiding this comment.
The signature for R.call_dps_packed should include out_sinfo to be consistent with the R.call_tir entry above and to accurately reflect the required arguments in Relax TVMScript.
Suggested change
| - ``R.call_dps_packed(func, *args)`` — call using destination-passing style | |
| - ``R.call_dps_packed(func, args, out_sinfo)`` — call using destination-passing style |
| - TIR ``If`` branch (PrimExpr condition) or static eval (Python bool) | ||
| - Relax ``If`` node (plain Python ``if cond:`` syntax) | ||
| * - ``while`` | ||
| - ``T.While`` loop |
Contributor
MasterJH5574
approved these changes
Apr 13, 2026
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 adds architecture documentation for TVMScript, the Python-based DSL used to author and inspect TVM IR.
TVMScript is used throughout the codebase (deep dive tutorials, tests, examples) but previously had no documentation explaining its own design or syntax. Users could only learn TVMScript by reading examples in TIR/Relax tutorials. So this PR adds a doc for it.