Skip to content

Conversation

@jiahanc
Copy link
Collaborator

@jiahanc jiahanc commented Nov 13, 2025

📌 Description

Deprecate tile_token_dim in trtllm_moe. It is already not used and mark with deprecation warning, plan to deprecate totally in next major release

🔍 Related Issues

🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.

✅ Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.

If you are unsure about how to set up pre-commit, see the pre-commit documentation.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

Reviewer Notes

Summary by CodeRabbit

  • Refactor
    • Removed the deprecated tile_tokens_dim parameter from MOE benchmarks and kernel functions, streamlining API calls and eliminating associated deprecation warnings.

Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

This PR removes the deprecated tile_tokens_dim parameter from the fused MOE kernel suite across the Python API layer, benchmark infrastructure, test suites, and C++ implementations, eliminating the parameter from all related function signatures and call sites.

Changes

Cohort / File(s) Summary
Python API Layer
flashinfer/fused_moe/core.py
Removed tile_tokens_dim parameter from function signatures: trtllm_fp8_per_tensor_scale_moe, trtllm_fp8_block_scale_moe, trtllm_fp4_block_scale_moe, and trtllm_fp4_block_scale_routed_moe; eliminated associated deprecation warning blocks.
Test Suites
tests/moe/test_trtllm_gen_fused_moe.py, tests/moe/test_trtllm_gen_routed_fused_moe.py
Removed tile_tokens_dim=None arguments from MOE kernel invocation call sites across multiple test functions.
Benchmark Automation
benchmarks/bench_trtllm_gen_fused_moe_autotuner.py
Removed tile_tokens_dim argument from three autotuner function invocations (FP8 block-scale, FP8 per-tensor, FP4 block-scale paths).
Benchmark Infrastructure
benchmarks/routines/moe.py, benchmarks/routines/flashinfer_benchmark_utils.py
Removed CLI flag --tile_tokens_dim from parse_moe_args; deleted tile_tokens_dim from MOE test functions and result dictionaries; removed tile_tokens_dim entry from output column definitions.
Documentation & Samples
benchmarks/README.md, benchmarks/samples/sample_testlist_output.txt
Updated documentation to remove MOE flag reference; modified sample test output to exclude tile_tokens_dim from argument blocks.
C++ Implementation
csrc/trtllm_fused_moe_kernel_launcher.cu
Removed deprecation comments noting the mapping of tile_N to tile_tokens_dim from FP8 per-tensor, FP8 block-scale, and FP4 block-scale launcher sections.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Call site verification: Ensure all tile_tokens_dim usages are removed consistently across Python API, benchmarks, and test modules; no orphaned references remain.
  • API signature alignment: Confirm that function signature changes in core.py match all downstream invocations in tests and benchmarks.
  • Sample output accuracy: Verify that sample_testlist_output.txt reflects current expected behavior after parameter removal.

Possibly related PRs

Suggested reviewers

  • cyx-6
  • djmmoss
  • bkryu
  • nvmbreughe
  • yzh119
  • wenscarl

Poem

🐰 A parameter departs, clean and neat,
tile_tokens_dim bids its farewell sweet!
Through benchmarks and tests, the removal flows,
The MOE kernels shine as the old code goes. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description explains the deprecation purpose and mentions the next major release plan, but lacks related issue links and all checklist items are not properly marked. Add related GitHub issue link in the '🔍 Related Issues' section and ensure all checklist items are properly marked (currently only pre-commit checks show completion).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: deprecating tile_token_dim in trtllm_moe, which aligns with the PR's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jiahanc
Copy link
Collaborator Author

jiahanc commented Nov 13, 2025

/bot run

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jiahanc, 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 completes the deprecation process for the tile_tokens_dim parameter within the trtllm_moe implementation. This parameter was identified as unused and had a deprecation warning in place. Its removal simplifies the API, cleans up the codebase by eliminating dead code, and updates all relevant documentation, benchmarks, and tests to reflect this change.

Highlights

  • Deprecation of tile_tokens_dim: The tile_tokens_dim parameter has been fully deprecated and removed from the trtllm_moe codebase, as it was previously marked as unused and slated for removal in a future major release.
  • Codebase Cleanup: References to tile_tokens_dim have been removed across various files, including benchmark scripts, utility functions, core MoE implementations, and test cases, streamlining the code and removing dead parameters.
  • Documentation and Sample Updates: The benchmarks/README.md and sample output files (sample_testlist_output.csv, sample_testlist_output.txt) have been updated to reflect the removal of the tile_tokens_dim argument.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@flashinfer-bot
Copy link
Collaborator

GitLab MR !135 has been created, and the CI pipeline #38434421 is currently running. I'll report back once the pipeline job completes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54101e9 and 9f3e3b1.

⛔ Files ignored due to path filters (1)
  • benchmarks/samples/sample_testlist_output.csv is excluded by !**/*.csv
📒 Files selected for processing (9)
  • benchmarks/README.md (1 hunks)
  • benchmarks/bench_trtllm_gen_fused_moe_autotuner.py (0 hunks)
  • benchmarks/routines/flashinfer_benchmark_utils.py (0 hunks)
  • benchmarks/routines/moe.py (0 hunks)
  • benchmarks/samples/sample_testlist_output.txt (6 hunks)
  • csrc/trtllm_fused_moe_kernel_launcher.cu (0 hunks)
  • flashinfer/fused_moe/core.py (0 hunks)
  • tests/moe/test_trtllm_gen_fused_moe.py (0 hunks)
  • tests/moe/test_trtllm_gen_routed_fused_moe.py (0 hunks)
💤 Files with no reviewable changes (7)
  • benchmarks/routines/flashinfer_benchmark_utils.py
  • csrc/trtllm_fused_moe_kernel_launcher.cu
  • tests/moe/test_trtllm_gen_fused_moe.py
  • tests/moe/test_trtllm_gen_routed_fused_moe.py
  • benchmarks/bench_trtllm_gen_fused_moe_autotuner.py
  • flashinfer/fused_moe/core.py
  • benchmarks/routines/moe.py
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
benchmarks/README.md

169-169: Table column count
Expected: 2; Actual: 3; Too many cells, extra data will be missing

(MD056, table-column-count)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy Docs
🔇 Additional comments (1)
benchmarks/samples/sample_testlist_output.txt (1)

359-359: Verify consistency of tile_tokens_dim removal across MOE samples.

The sample output shows an inconsistency: TensorRT-LLM MOE test cases (lines 295–339) do not include tile_tokens_dim in their Namespace arguments, but CUTLASS MOE test cases (lines 359, 368, 377, 386) still show tile_tokens_dim=8.

Given the PR's goal to deprecate tile_tokens_dim, clarify whether this removal is backend-specific (trtllm only) or if CUTLASS sample outputs also need updating.

Also applies to: 368-368, 377-377, 386-386

| `--local_expert_offset` | Offset of local experts in global expert space. Default: 0 |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts |
| `--tile_tokens_dim` | Tile dimension for tokens. Default: 8 |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts | |
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdown table formatting on line 169.

Line 169 has extra pipe delimiters causing a column count mismatch (expected 2, actual 3). This breaks markdown table rendering.

Apply this diff to fix the formatting:

-| `--local_num_experts`    | Number of experts handled by this device. Default: equals num_experts                                      |                                                                    |
+| `--local_num_experts`    | Number of experts handled by this device. Default: equals num_experts                                      |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts | |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

169-169: Table column count
Expected: 2; Actual: 3; Too many cells, extra data will be missing

(MD056, table-column-count)

🤖 Prompt for AI Agents
In benchmarks/README.md around line 169, the markdown table row has an extra
pipe delimiter causing a 3-column row while the table expects 2 columns; remove
the surplus pipe(s) so the row contains exactly two cells (option name and
description) and ensure the row follows the same leading/trailing pipe
convention as the table header and other rows for consistent rendering.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code rabbit, seems false alarm as that last "|" was extra in the first place?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aleozlx You're absolutely right! This is definitely not a false alarm. The extra | and trailing spaces were accidentally introduced in this PR when the tile_tokens_dim row was removed.

The original line had the correct 2-column format:

| `--local_num_experts`    | Number of experts handled by this device. Default: equals num_experts                                      |

But the new version has an extra pipe creating a malformed 3-column row:

| `--local_num_experts`    | Number of experts handled by this device. Default: equals num_experts                                      |                                                                    |

The suggested fix removes that extra content to restore proper markdown table formatting. Please apply the suggestion to fix the table rendering. 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiahanc i misread the suggestion as the code diff earlier, this seems a real syntax error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively deprecates the tile_token_dim parameter from the trtllm_moe API. The changes are applied consistently across the codebase, including the Python API in flashinfer/fused_moe/core.py, benchmark scripts, tests, and documentation. The removal of the parameter and its associated logic simplifies the code and aligns with the stated goal. I've found one minor formatting issue in the documentation that should be addressed.

| `--local_expert_offset` | Offset of local experts in global expert space. Default: 0 |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts |
| `--tile_tokens_dim` | Tile dimension for tokens. Default: 8 |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There seems to be a formatting issue in this line. It has a lot of trailing whitespace and an extra pipe character at the end. This was likely introduced accidentally when removing the --tile_tokens_dim line.

Suggested change
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts | |
| `--local_num_experts` | Number of experts handled by this device. Default: equals num_experts |

Copy link
Collaborator

@aleozlx aleozlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed, looks good

Copy link
Collaborator

@yzh119 yzh119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For next release, it should be v0.6.0, if we tag v0.5.3, the release branch should skip this commit.

@yzh119 yzh119 merged commit 9a79b78 into flashinfer-ai:main Nov 14, 2025
4 checks passed
qsang-nv pushed a commit to qsang-nv/flashinfer that referenced this pull request Nov 18, 2025
<!-- .github/pull_request_template.md -->

## 📌 Description
Deprecate `tile_token_dim` in trtllm_moe. It is already not used and
mark with deprecation warning, plan to deprecate totally in next major
release
<!-- What does this PR do? Briefly describe the changes and why they’re
needed. -->

## 🔍 Related Issues

<!-- Link any related issues here -->

## 🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.

### ✅ Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.

> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).

## 🧪 Tests

- [ ] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).

## Reviewer Notes

<!-- Optional: anything you'd like reviewers to focus on, concerns, etc.
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Removed the deprecated `tile_tokens_dim` parameter from MOE benchmarks
and kernel functions, streamlining API calls and eliminating associated
deprecation warnings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
yzh119 added a commit that referenced this pull request Nov 20, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 20, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants