[TIRx] Flatten cuda/trn backend operator folder - #20081
Merged
Merged
Conversation
Move intrinsics/ and tile_primitive/ out of backend/cuda/operator/ up to backend/cuda/, and tile_primitive/ out of backend/trn/operator/ up to backend/trn/. The operator package was an empty shell that only re-exported its subpackages, added a path segment, and shadowed the stdlib operator name. No compatibility shim: all in-repo imports (source, tests, docs) are rewritten to the new paths. The tvm.tirx.<backend>.* alias redirect picks the new paths up automatically, and tirx-kernels is updated in a companion commit. Verified with the full TIRx suite on 8x B200: 2620 passed, 41 skipped, 3 xpassed, with both kernel import gates green.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
The gpu docs precheck fails on any non-allowlisted WARNING. The new backend.rst sections tripped it twice: - tile_primitive/__init__.py star-imports its submodules without __all__, so :imported-members: leaked every transitively imported name (tvm.tirx expr/stmt/layout classes, arith.Analyzer, dataclasses.replace), producing duplicate-description warnings and docutils errors from non-RST docstrings. - intrinsics/__init__.py defines __all__, and __all__-listed imported members are documented even without :imported-members:, so PTXDataType got indexed twice (duplicate-description warning). Drop :imported-members: from the tile_primitive section (empty page, same as the old operator section) and add :no-index: to the intrinsics section (content still rendered, not indexed). Verified locally with a minimal sphinx 8.1.3 build: zero warnings.
tlopex
approved these changes
Aug 1, 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.
Summary
Flatten the CUDA/TRN backend Python layout by removing the pass-through
operatorpackage layer:tvm.backend.cuda.operator.intrinsics→tvm.backend.cuda.intrinsicstvm.backend.cuda.operator.tile_primitive→tvm.backend.cuda.tile_primitivetvm.backend.trn.operator.tile_primitive→tvm.backend.trn.tile_primitiveThe
operatorpackage was an empty shell: its__init__.pyonly re-exported its subpackages, it added a meaningless path segment, and it shadowed the stdliboperatorname. No compatibility shim is kept; all in-repo imports (source, tests, docs) are rewritten, and thetvm.tirx.<backend>.*alias redirect picks the new paths up automatically. Cross-package references inside the moved packages are relative imports that resolve unchanged after the one-level move.Companion kernel-side PR: mlc-ai/tirx-kernels#13.
Test
Full TIRx suite on 8x B200 (16 xdist workers):
2620 passed, 41 skipped, 3 xpassedin 386s;bench_suite --check-importsandregistry --cc 10 --strictimport gates green;pre-commitgreen.