[REFACTOR][SCRIPT] Revive buffer_dtype as a top-level PrinterConfig field#19640
Closed
tqchen wants to merge 1 commit into
Closed
[REFACTOR][SCRIPT] Revive buffer_dtype as a top-level PrinterConfig field#19640tqchen wants to merge 1 commit into
tqchen wants to merge 1 commit into
Conversation
…ield buffer_dtype was moved to extra_config in the tvmscript streamline refactor, but it is conceptually a shared scalar-literal default alongside int_dtype and float_dtype, not a dialect-specific knob. Restore it as a top-level named field on PrinterConfigNode (and the Python PrinterConfig mirror), with the same DataType::Float(32) default and the same top-level cfg-dict conversion pattern as the sibling dtype fields. Update the single C++ reader in src/tirx/script/printer/buffer.cc to use cfg->buffer_dtype directly.
Contributor
There was a problem hiding this comment.
Code Review
This pull request promotes buffer_dtype from a dialect-specific extra configuration option (tirx.buffer_dtype) to a first-class configuration field in PrinterConfig. This change is implemented across the C++ header, Python bindings, and parsing logic. There are no review comments to address, and the changes appear correct and complete.
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.
Summary
Restore
buffer_dtypeas a top-level field onPrinterConfig(alongsideint_dtypeandfloat_dtype). The tvmscript streamline refactor moved it intoextra_config, butbuffer_dtypeis a shared scalar-literal default rather than a dialect-specific knob. Bringing it back to top-level keeps it discoverable, type-checked at the C++ layer, and consistent with its sibling scalar dtype fields.Files
include/tvm/script/printer/config.h— restoreDataType buffer_dtypefield + reflection registration.src/script/printer/script_printer.cc— restore the top-level"buffer_dtype"string→DataType conversion in thePrinterConfigconstructor.src/tirx/script/printer/buffer.cc— usecfg->buffer_dtypedirectly instead ofGetExtraConfig<DataType>("tirx.buffer_dtype", ...).python/tvm/runtime/script_printer.py— re-addbuffer_dtype: str = "float32"field and kwarg.