[None][perf] add Dynamic SMEM block routing in MOE#12456
Merged
kaiyux merged 2 commits intoNVIDIA:mainNVIDIA/TensorRT-LLM:mainfrom Mar 24, 2026
Merged
[None][perf] add Dynamic SMEM block routing in MOE#12456kaiyux merged 2 commits intoNVIDIA:mainNVIDIA/TensorRT-LLM:mainfrom
kaiyux merged 2 commits intoNVIDIA:mainNVIDIA/TensorRT-LLM:mainfrom
Conversation
Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #39932 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #39932 [ run ] completed with state |
longcheng-nv
pushed a commit
to longcheng-nv/TensorRT-LLM
that referenced
this pull request
Mar 31, 2026
Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
5 tasks
jiahanc
pushed a commit
to flashinfer-ai/flashinfer
that referenced
this pull request
Apr 13, 2026
…PdlOverlapWithNext;Remove DeepSeekV3 float32 logits constraint from kernel launchers <!-- .github/pull_request_template.md --> ## 📌 Description 1. Add dynamic block kernel (`routingIndicesDynBlockKernel`) comes from the TensorRT-LLM. NVIDIA/TensorRT-LLM#12456 . Made related modification by refactoring `LAUNCH_ROUTING_CUSTOM` with `dispatchRoutingPolicy` and `queryDispatchedMaxExperts` 2. Simplify PDL (Programmatic Dependent Launch) for routing kernels, as the bug related to PDL is solved. 3. Added a default fallback tier (`Tier<1024, 32>`) to support future models with >512 experts using the DeepSeek nGroup≤1 / MiniMax2 routing policy. 4. Remove DeepSeekV3 float32 logits constraint 5. Improve policy tier dispatch error messages ## 🔍 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 ``` python -m pytest tests/moe/test_trtllm_gen_fused_moe.py -k "test_dyn_block_kernel_routing or test_tier_1024_experts_routing" -xvs python3 -m pytest tests/moe/test_trtllm_gen_fused_moe.py -k "test_routing_dtype_flexibility" -xvs ``` - [x] Tests have been added or updated as needed. - [x] 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 * **New Features** * Dynamic single-block routing for small token/expert workloads to improve performance. * **Improvements** * Added a 1024-expert policy tier and clearer tier-dispatch diagnostics. * More flexible routing/logits dtype handling and simplified kernel overlap/launch synchronization. * Automatic histogram-thread sizing and removal of legacy cluster-size/overlap public flags. * Autotuner now initializes packed TopK with per-token unique expert IDs. * **Tests** * Added tests for dynamic-block routing, 1024-expert tier, MiniMax2 routing, and routing dtype combinations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Christina Zhang <83400082+ChristinaZ@users.noreply.github.com>
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.
@coderabbitai summary
Description
Add dynamic SMEM block routing kernel in TRTLLM MOE to optimize the routing kernel in 4-16 token range
Test Coverage
Added C++ unit test
Run with
./tests/unit_tests/kernels/routingKernelsTest --gtest_filter="*DynBlock*"PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.