Repository navigation
[None][perf] Overlap the Mistral Large 4 SM107 decode shared expert with the routed experts - #22253
Merged
yizhang-nv merged 1 commit intoNov 16, 2026
Conversation
…ed experts In the SM107 tp4/tp8 decode target, run each MoE layer's shared expert (FP8 gate/up, SiLU-and-mul, FP8 down) on a side stream while the main stream runs the router GEMM, the routing, the NVFP4 quantization and the routed-expert runner. The two partial sums join before the closing all-reduce. The side stream is used only under CUDA-graph capture, via maybe_execute_in_parallel; eager and context steps are unchanged. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream for A/B comparison. Signed-off-by: yt0428 <[email protected]>
yt0428
requested review from
Wanli-Jiang,
WeiHaocheng and
litaotju
as code owners
November 13, 2026 09:37
Collaborator
Author
|
/bot skip --comment "Format check only" |
Collaborator
|
PR_Github #84736 [ skip ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #84736 [ skip ] completed with state |
Closed
1 task done
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 17, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
1 task
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 20, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 23, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 24, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
yizhang-nv
added a commit
to yizhang-nv/TensorRT-LLM
that referenced
this pull request
Nov 26, 2026
…with the routed experts Port of feat/mistral-large-4 061ec01 (NVIDIA#22253) onto this branch, in the sm_107 tp target (mistral_large_4_nvfp4__sm_107__tp, NVIDIA#22253's __sm_107__tp4). Under CUDA-graph capture the MoE layer's shared expert runs on a side stream (maybe_execute_in_parallel) while the main stream runs the router, the NVFP4 quantization and the routed experts. Both orders compute the same bits. TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1 keeps the shared expert on the main stream. Signed-off-by: Yi Zhang <[email protected]>
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
In the Mistral Large 4 SM107 (VR200) TP4/TP8 decode target, each MoE layer's shared expert now runs on a side stream, overlapped with the routed-expert path.
What changes (
mistral_large_4_nvfp4__sm_107__tp4/modeling.pyonly)DecodeTarget._mlpsplits intorouted()andshared()closures, run throughmaybe_execute_in_parallelwith a per-target side stream and fork/join events.maybe_execute_in_paralleluses the side stream only under CUDA graph capture, so eager and context steps are unchanged. Dense layers are also unchanged.TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1, read at launch in every rank, keeps the shared expert on the main stream for A/B comparison. Both orders compute the same bits.VR200 results
This end-to-end A/B ran on top of the other VR200 decode optimizations (split Top-K, fused FP8 linear, LowM GEMM and SparseMLA global split), not on this PR's base alone. Setup: DSpark K3 with a synthetic acceptance length of 2.772, 20 min per point,
stream_interval=1, one run per point.Not measured yet
TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1on the same build.Test Coverage
No new unit tests: the change only reorders the work across streams inside the decode target, and the computed values are unchanged.
TRTLLM_MODELING_V2_SERIAL_SHARED_EXPERT=1restores the previous serial order for bisecting.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)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.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.🤖 Generated with Claude Code