Conversation
This PR renames the tir namespace to tirx across the codebase: - include/tvm/tir/ → include/tvm/tirx/ - src/tir/ → src/tirx/ - python/tvm/tir/ → python/tvm/tirx/ - C++ namespace tvm::tir → tvm::tirx - All FFI strings, op registrations, and type keys updated
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a significant refactoring of the TensorIR (TIR) infrastructure by introducing a new Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a large-scale refactoring to rename the tir namespace to tirx. The changes are extensive, touching code, documentation, and configuration files. The modifications appear to be mostly correct and consistent with the refactoring goal. I've identified a few minor inconsistencies in the documentation that should be updated for clarity and consistency.
docs/arch/index.rst
Outdated
| tirx transformations contain a collection of passes that apply to tirx functions. There are two major types of transformations: | ||
|
|
||
| - **TensorIR schedule**: TensorIR schedules are designed to optimize the TensorIR functions for a specific target, with user-guided instructions and control how the target code is generated. | ||
| For CPU targets, TIR PrimFunc can generate valid code and execute on the target device without schedule but with very-low performance. However, for GPU targets, the schedule is essential |
There was a problem hiding this comment.
For consistency with other parts of the document (e.g., line 67 which uses tirx::PrimFunc), TIR PrimFunc should be updated to tirx::PrimFunc.
| For CPU targets, TIR PrimFunc can generate valid code and execute on the target device without schedule but with very-low performance. However, for GPU targets, the schedule is essential | |
| For CPU targets, tirx::PrimFunc can generate valid code and execute on the target device without schedule but with very-low performance. However, for GPU targets, the schedule is essential |
docs/arch/index.rst
Outdated
| for generating valid code with thread bindings. For more details, please refer to the :ref:`TensorIR Transformation <tir-transform>` section. Additionally, we provides ``MetaSchedule`` to | ||
| for generating valid code with thread bindings. For more details, please refer to the :ref:`TensorIR Transformation <tirx-transform>` section. Additionally, we provides ``MetaSchedule`` to | ||
| automate the search of TensorIR schedule. | ||
| - **Lowering Passes**: These passes usually perform after the schedule is applied, transforming a TIR PrimFunc into another functionally equivalent PrimFunc, but closer to the |
There was a problem hiding this comment.
For consistency with other parts of the document, a TIR PrimFunc should be updated to a tirx::PrimFunc.
| - **Lowering Passes**: These passes usually perform after the schedule is applied, transforming a TIR PrimFunc into another functionally equivalent PrimFunc, but closer to the | |
| - **Lowering Passes**: These passes usually perform after the schedule is applied, transforming a tirx::PrimFunc into another functionally equivalent PrimFunc, but closer to the |
docs/arch/index.rst
Outdated
| Apache TVM enables cross-level optimization of end-to-end models. As the IRModule includes both relax and tirx functions, the cross-level transformations are designed to mutate | ||
| the IRModule by applying different transformations to these two types of functions. | ||
|
|
||
| For example, ``relax.LegalizeOps`` pass mutates the IRModule by lowering relax operators, adding corresponding TIR PrimFunc into the IRModule, and replacing the relax operators |
There was a problem hiding this comment.
For consistency, TIR PrimFunc should be updated to tirx::PrimFunc.
| For example, ``relax.LegalizeOps`` pass mutates the IRModule by lowering relax operators, adding corresponding TIR PrimFunc into the IRModule, and replacing the relax operators | |
| For example, ``relax.LegalizeOps`` pass mutates the IRModule by lowering relax operators, adding corresponding tirx::PrimFunc into the IRModule, and replacing the relax operators |
docs/arch/index.rst
Outdated
| TIR contains the definition of the low-level program representations. We use `tirx::PrimFunc` to represent functions that can be transformed by TIR passes. | ||
| Besides the IR data structures, the tirx module also includes: | ||
|
|
||
| - A set of schedule primitives to control the generated code in ``tir/schedule``. | ||
| - A set of builtin intrinsics in ``tir/tensor_intrin``. | ||
| - A set of analysis passes to analyze the TIR functions in ``tir/analysis``. | ||
| - A set of transformation passes to lower or optimize the TIR functions in ``tir/transform``. | ||
| - A set of schedule primitives to control the generated code in ``tirx/schedule``. | ||
| - A set of builtin intrinsics in ``tirx/tensor_intrin``. | ||
| - A set of analysis passes to analyze the TIR functions in ``tirx/analysis``. | ||
| - A set of transformation passes to lower or optimize the TIR functions in ``tirx/transform``. |
There was a problem hiding this comment.
For consistency with the rest of the refactoring, TIR passes should be tirx passes, and TIR functions should be tirx functions.
| TIR contains the definition of the low-level program representations. We use `tirx::PrimFunc` to represent functions that can be transformed by TIR passes. | |
| Besides the IR data structures, the tirx module also includes: | |
| - A set of schedule primitives to control the generated code in ``tir/schedule``. | |
| - A set of builtin intrinsics in ``tir/tensor_intrin``. | |
| - A set of analysis passes to analyze the TIR functions in ``tir/analysis``. | |
| - A set of transformation passes to lower or optimize the TIR functions in ``tir/transform``. | |
| - A set of schedule primitives to control the generated code in ``tirx/schedule``. | |
| - A set of builtin intrinsics in ``tirx/tensor_intrin``. | |
| - A set of analysis passes to analyze the TIR functions in ``tirx/analysis``. | |
| - A set of transformation passes to lower or optimize the TIR functions in ``tirx/transform``. | |
| TIR contains the definition of the low-level program representations. We use `tirx::PrimFunc` to represent functions that can be transformed by tirx passes. | |
| Besides the IR data structures, the tirx module also includes: | |
| - A set of schedule primitives to control the generated code in ``tirx/schedule``. | |
| - A set of builtin intrinsics in ``tirx/tensor_intrin``. | |
| - A set of analysis passes to analyze the tirx functions in ``tirx/analysis``. | |
| - A set of transformation passes to lower or optimize the tirx functions in ``tirx/transform``. |
This PR brings up the tirx namespace. We have been spliting out the original tir namespace to include high-level component s_tir and this PR updates the remaining low-level part as tirx namespace