Repository navigation
[None][feat] Kimi K3 optimizations on Rubin - #19960
Conversation
1a6b257 to
1b1f238
Compare
|
A data point for the We run the same change on Kimi K3 + DSpark (7 drafts, 8-token verify) on SM107, 8 GPUs over 2 nodes, with the current
Since it is a self-contained, output-identical win that does not depend on the rest of the Rubin stack, would it make sense to split it out of this draft into a small PR so it can land earlier? I am happy to open one if you prefer. |
|
On the K3 MoE routing prologue: we worked on the other routing path, the scores path where For 5..8 tokens with more than 256 experts, that path uses Your PR moves K3 to a separate small-batch top-k plus the post-topK permutation (dyn-block at <= 12 tokens). Two questions, so we can decide where this should go:
cc @reasonsolo |
|
A data point for widening Same setup as my comment above (Kimi K3 + DSpark, 8-token verify, SM107, 8 GPUs over 2 nodes), only this gate changed, fresh server for each arm:
So about -6.7 to -6.9 ms per step at every length; acceptance is set by the drafter and the target, not by the verify kernel. Prefill goes through FLA in both arms. TTFT went up by 0.26 s (+2.1%) at 128K and 0.23 s (+0.5%) at 393K; part of that is the per-chunk replay-window write the fused verify adds to prefill (0.8-1.7 ms per chunk), the rest we could not separate from server-to-server variation. Outputs are not token-identical to the FLA path, as expected from a different kernel: the first generated token matched on 40/40 prompts, and the mean shared-prefix fraction of the greedy continuations against the FLA path was 0.658. The differences are deterministic (two cold starts of the fused path were token-identical on 40/40), and when I scored the divergence points with logprobs from a non-speculative reference run, none of the 18 scorable ones was a high-confidence divergence (largest |logit margin| 1.25 nats). Our accuracy checks did not change. So +1 for enabling 107 here. If this PR stays in draft for a while, would you be OK with me sending just the one-line gate change as a separate small PR? |
1b1f238 to
f09d991
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #78046 [ run ] triggered by Bot. Commit: |
f09d991 to
05904c1
Compare
|
@reasonsolo @pengbowang-nv: since this merged, one case of It hit DGX_B200-PyTorch-4 and DGX_H100-PyTorch-5 on L0 #64787 (#20250, which doesn't touch attention). The test is host-only, so it fails the same way on any GPU. This is a semantic merge conflict between two PRs:
The other 9 parameter rows still pass. Which side is right is your call. Either the row should expect |
Move the cutedsl-megamoe vendor from bangyus/cutedsl_megamoe main 382ce4a6 to main 7832a330. The selected file set is unchanged. The lock and compatibility patch were updated only with scripts/vendor_sources.py: the existing patch no longer applies to 7832a330, so the destination was set to the exact upstream selection and pinned with "pin" (which drops a patch that cannot apply when the destination is exact upstream), and the TensorRT-LLM compatibility edits were then re-applied and recorded with "patch create". Upstream commits that touch the vendored files: - 43af6d6c Report deterministic router overflow group-wide (token_comm_deterministic.py; merged via 822e739b) - d921a6b6 router: partition the metadata push by route index (MR !78) (token_comm.py) - 13434224 publish fc1/fc2 done with red.async.release (epi_async_release; Blackwell fc12 epilogue and MegaMoE kernel) - bd19a17b Blackwell bf16 swapab kernel for training forward pass (BF16 wire, token_in_stage_split, external_dispatch_pool in token_comm.py and token_comm_deterministic.py) - ce9173db Fix GenPhase workspace reset ordering (Rubin genphase MegaMoE kernel) - 76676a54 FC1 per-token activation scale for the Blackwell nvfp4 MegaMoE path (opt-in; also adds gate_activation="quick_geglu" and the megamoe_aot trailing optional argument) Compatibility patch, re-applied on 7832a330 (TensorRT-LLM-only): - SwiGLU swiglu_alpha/swiglu_beta support in the Blackwell and Rubin MegaMoE kernels and epilogues (MiniMax-M3). The Blackwell epilogue now derives its sigmoid exp2 constant from a quick_geglu scale; swiglu_alpha sets that scale, giving the same -alpha * log2e constant as before, and gate_activation="quick_geglu" is rejected together with SwiGLUBias constants, as SiTU already is. - "# nosec B105" on token_* region names and mode-string comparisons for bandit. The new upstream code needs no additional annotations. - Removal of "if stream_ends_before_target: fc1_exhausted = Boolean(True)" in PhaseInterleavedFc12Scheduler, as on TensorRT-LLM main (NVIDIA#19960). - Removal of the perf-number comment in helpers/topk_reduce.py. TensorRT-LLM integration needs no adaptation. The new descriptor keys (gate_activation, fc1_activation_per_token_scale, epi_async_release, token_in_stage_split, external_dispatch_pool) and the trailing fc1_activation_per_token_scale kernel argument are optional, and TensorRT-LLM does not set them. Blackwell MegaMoE and the shared FC12 kernel therefore use the upstream default epi_async_release=True, which requires epilogue flag batches <= 4; every TensorRT-LLM tactic uses (1, 1), (1, 4) or (2, 4). Workspace sizes are unchanged for TensorRT-LLM configurations. Signed-off-by: jintaop <jintaop@nvidia.com>
Move the cutedsl-megamoe vendor from bangyus/cutedsl_megamoe main 382ce4a6 to main 7832a330. The selected file set is unchanged. The lock and compatibility patch were updated only with scripts/vendor_sources.py: the existing patch no longer applies to 7832a330, so the destination was set to the exact upstream selection and pinned with "pin" (which drops a patch that cannot apply when the destination is exact upstream), and the TensorRT-LLM compatibility edits were then re-applied and recorded with "patch create". Upstream commits that touch the vendored files: - 43af6d6c Report deterministic router overflow group-wide (token_comm_deterministic.py; merged via 822e739b) - d921a6b6 router: partition the metadata push by route index (MR !78) (token_comm.py) - 13434224 publish fc1/fc2 done with red.async.release (epi_async_release; Blackwell fc12 epilogue and MegaMoE kernel) - bd19a17b Blackwell bf16 swapab kernel for training forward pass (BF16 wire, token_in_stage_split, external_dispatch_pool in token_comm.py and token_comm_deterministic.py) - ce9173db Fix GenPhase workspace reset ordering (Rubin genphase MegaMoE kernel) - 76676a54 FC1 per-token activation scale for the Blackwell nvfp4 MegaMoE path (opt-in; also adds gate_activation="quick_geglu" and the megamoe_aot trailing optional argument) Compatibility patch, re-applied on 7832a330 (TensorRT-LLM-only): - SwiGLU swiglu_alpha/swiglu_beta support in the Blackwell and Rubin MegaMoE kernels and epilogues (MiniMax-M3). The Blackwell epilogue now derives its sigmoid exp2 constant from a quick_geglu scale; swiglu_alpha sets that scale, giving the same -alpha * log2e constant as before, and gate_activation="quick_geglu" is rejected together with SwiGLUBias constants, as SiTU already is. - "# nosec B105" on token_* region names and mode-string comparisons for bandit. The new upstream code needs no additional annotations. - Removal of "if stream_ends_before_target: fc1_exhausted = Boolean(True)" in PhaseInterleavedFc12Scheduler, as on TensorRT-LLM main (NVIDIA#19960). - Removal of the perf-number comment in helpers/topk_reduce.py. TensorRT-LLM integration needs no adaptation. The new descriptor keys (gate_activation, fc1_activation_per_token_scale, epi_async_release, token_in_stage_split, external_dispatch_pool) and the trailing fc1_activation_per_token_scale kernel argument are optional, and TensorRT-LLM does not set them. Blackwell MegaMoE and the shared FC12 kernel therefore use the upstream default epi_async_release=True, which requires epilogue flag batches <= 4; every TensorRT-LLM tactic uses (1, 1), (1, 4) or (2, 4). Workspace sizes are unchanged for TensorRT-LLM configurations. Signed-off-by: jintaop <jintaop@nvidia.com>
Thanks @chenfeiz0326 for the report. Do we have a waive/nvbugs for this one? Also cc @reasonsolo , the threshold is profiled on B200 with kvlen=8192, is this a reasonable test config and would it have negative impact based on your data? Thanks! |
…the cute_dsl_kernels split NVIDIA#19960 added eight imports under tensorrt_llm._torch.cute_dsl_kernels, which this PR removes. The modules they name now live in the Attention and MoE kernel trees, so point the imports there: - tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py: mla_helpers -> attention.kernels.blackwell.mla.mla_helpers - tensorrt_llm/_torch/modules/kimi_kda/_kda_kernels.py and tests/unittest/_torch/executor/kv_cache/test_mamba_cache_manager.py: kimi_k3_kda.kda_mtp_decode -> attention.kernels.blackwell.kimi_k3_kda.kda_mtp_decode - tests/unittest/_torch/moe/test_moe_backend.py: five cutedsl_megamoe modules -> moe.kernels.cutedsl_megamoe The target modules are unchanged copies of the ones the old paths named; only the import paths change. Signed-off-by: Yihui Lu <269394165+YihuiLu512@users.noreply.github.com>
Restore the MoESchedulerKind import in modeling_kimi_linear.py: NVIDIA#19960 added new uses of it on main. Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Brings in main's Kimi K3 DWDP support (NVIDIA#19960), which the standard Kimi K3 context-only configuration (DWDP16) needs. Conflicts: - 3rdparty/fetch_content.json: DeepGEMM applies main's deepgemm_configurable_barrier_timeout.patch, then deepgemm_trtllm.patch, which is rebased onto it (only deep_gemm/__init__.py's context moves: the two barrier-timeout exports precede take_compiled_kernel_names). - glm_kpool/kernels.py: keep the kpool_score launch-template record and main's max_kv_len grid bound. - decoder/runner.py: keep the FlashInfer helper join before CUDA graph capture, and main's _warmup_and_capture_cuda_graphs (which now owns the MoE serving-timeout scope at capture); keep the removal of the DSv4 indexer-Q CuTe DSL prewarm (a no-op on main: its import path no longer exists). - model_engine.py: main's typing imports plus SimpleNamespace. Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
…the cute_dsl_kernels split NVIDIA#19960 added eight imports under tensorrt_llm._torch.cute_dsl_kernels, which this PR removes. The modules they name now live in the Attention and MoE kernel trees, so point the imports there: - tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py: mla_helpers -> attention.kernels.blackwell.mla.mla_helpers - tensorrt_llm/_torch/modules/kimi_kda/_kda_kernels.py and tests/unittest/_torch/executor/kv_cache/test_mamba_cache_manager.py: kimi_k3_kda.kda_mtp_decode -> attention.kernels.blackwell.kimi_k3_kda.kda_mtp_decode - tests/unittest/_torch/moe/test_moe_backend.py: five cutedsl_megamoe modules -> moe.kernels.cutedsl_megamoe The target modules are unchanged copies of the ones the old paths named; only the import paths change. Signed-off-by: Yihui Lu <269394165+YihuiLu512@users.noreply.github.com>
Remove the cutedsl-megamoe and megamoe-scheduler entries from 3rdparty/vendor_sources.lock.yaml, together with 3rdparty/vendor_patches/cutedsl-megamoe.patch. Both entries pointed at internal GitLab repositories, which the public repository should not reference. The lock is now identical to main. The sources under tensorrt_llm/_torch/cute_dsl_kernels/cutedsl_megamoe and megamoe_scheduler are unchanged and are maintained in-tree, as cutedsl_megamoe already is on main. They come from cutedsl_megamoe main 7832a330 plus the TensorRT-LLM edits the patch carried (SwiGLU alpha/beta, bandit B105 annotations, the NVIDIA#19960 fc12_scheduler change and one comment edit), and from the HALO-Q scheduler at 4dc86160. The ruff exclusion comment no longer says the sources are pinned. Signed-off-by: jintaop <jintaop@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 4 Kimi-K3 AgentX configs ran only as gen_only_no_context, because their DWDP16 ctx side could not start: Kimi K3 MoE raised NotImplementedError for DWDP at model init. Since NVIDIA#19960 Kimi K3 supports DWDP on the CUTEDSL MoE backend, which these configs use, so the ctx_only lanes can run. Add them back as they were held back in NVIDIA#20163: - l0_gb300_multi_nodes_perf_sanity_node4_gpu16: the 4 ctx_only ids, each the DWDP16 ctx side as one 16-GPU attention-DP server on 4 nodes. - GB300-16_GPUs-4_Nodes-PyTorch-PerfSanity-Node4-GPU16-Post-Merge, 4 splits, one test per split. The comments in the two gen_only_no_context lists now point at the new list instead of saying the ctx side cannot start. Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
…uce past fused-comm MegaMoE Backport the shared-expert all-reduce ordering from NVIDIA#19960 (e88d19c) to release/1.3. With MEGAMOE_CUTEDSL under TEP, the fused-comm kernel runs its own cross-rank exchange while the shared-expert all-reduce ran concurrently on the aux stream, which deadlocks at CUDA-graph warmup. The shared all-reduce now waits for the routed MoE. Only this ordering change and its unit tests are taken; the rest of NVIDIA#19960 is Rubin performance work and is not needed on release/1.3. Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Move the cutedsl-megamoe vendor from bangyus/cutedsl_megamoe main 382ce4a6 to main 7832a330. The selected file set is unchanged. The lock and compatibility patch were updated only with scripts/vendor_sources.py: the existing patch no longer applies to 7832a330, so the destination was set to the exact upstream selection and pinned with "pin" (which drops a patch that cannot apply when the destination is exact upstream), and the TensorRT-LLM compatibility edits were then re-applied and recorded with "patch create". Upstream commits that touch the vendored files: - 43af6d6c Report deterministic router overflow group-wide (token_comm_deterministic.py; merged via 822e739b) - d921a6b6 router: partition the metadata push by route index (MR !78) (token_comm.py) - 13434224 publish fc1/fc2 done with red.async.release (epi_async_release; Blackwell fc12 epilogue and MegaMoE kernel) - bd19a17b Blackwell bf16 swapab kernel for training forward pass (BF16 wire, token_in_stage_split, external_dispatch_pool in token_comm.py and token_comm_deterministic.py) - ce9173db Fix GenPhase workspace reset ordering (Rubin genphase MegaMoE kernel) - 76676a54 FC1 per-token activation scale for the Blackwell nvfp4 MegaMoE path (opt-in; also adds gate_activation="quick_geglu" and the megamoe_aot trailing optional argument) Compatibility patch, re-applied on 7832a330 (TensorRT-LLM-only): - SwiGLU swiglu_alpha/swiglu_beta support in the Blackwell and Rubin MegaMoE kernels and epilogues (MiniMax-M3). The Blackwell epilogue now derives its sigmoid exp2 constant from a quick_geglu scale; swiglu_alpha sets that scale, giving the same -alpha * log2e constant as before, and gate_activation="quick_geglu" is rejected together with SwiGLUBias constants, as SiTU already is. - "# nosec B105" on token_* region names and mode-string comparisons for bandit. The new upstream code needs no additional annotations. - Removal of "if stream_ends_before_target: fc1_exhausted = Boolean(True)" in PhaseInterleavedFc12Scheduler, as on TensorRT-LLM main (NVIDIA#19960). - Removal of the perf-number comment in helpers/topk_reduce.py. TensorRT-LLM integration needs no adaptation. The new descriptor keys (gate_activation, fc1_activation_per_token_scale, epi_async_release, token_in_stage_split, external_dispatch_pool) and the trailing fc1_activation_per_token_scale kernel argument are optional, and TensorRT-LLM does not set them. Blackwell MegaMoE and the shared FC12 kernel therefore use the upstream default epi_async_release=True, which requires epilogue flag batches <= 4; every TensorRT-LLM tactic uses (1, 1), (1, 4) or (2, 4). Workspace sizes are unchanged for TensorRT-LLM configurations. Signed-off-by: jintaop <jintaop@nvidia.com>
Remove the cutedsl-megamoe and megamoe-scheduler entries from 3rdparty/vendor_sources.lock.yaml, together with 3rdparty/vendor_patches/cutedsl-megamoe.patch. Both entries pointed at internal GitLab repositories, which the public repository should not reference. The lock is now identical to main. The sources under tensorrt_llm/_torch/cute_dsl_kernels/cutedsl_megamoe and megamoe_scheduler are unchanged and are maintained in-tree, as cutedsl_megamoe already is on main. They come from cutedsl_megamoe main 7832a330 plus the TensorRT-LLM edits the patch carried (SwiGLU alpha/beta, bandit B105 annotations, the NVIDIA#19960 fc12_scheduler change and one comment edit), and from the HALO-Q scheduler at 4dc86160. The ruff exclusion comment no longer says the sources are pinned. Signed-off-by: jintaop <jintaop@nvidia.com>
Bring the in-tree MegaMoE kernel copy from upstream main 7832a330 to f0747157. Of the six upstream commits, only ab23082d (CFK-38880, Rubin combine-dedup) touches the files TensorRT-LLM carries; f2b73b8e (gen-phase tactics) and 09b6b091 (BF16 top-k reducer) change training and pre_unification paths only. - Add the opt-in combine-dedup path: TokenCommDedup, SwapABGatedActEpilogueDedup and TopkReduceDedup, selected by the impl key combine_dedup (default False). It supports the BF16 combine format only, so the default NVFP4 path keeps its kernels; the compile key gains a _nodedup suffix, which invalidates the JIT cache once. - TokenSrcMetadata packs token:u16 | topk:u8 | rank:u8 | order:u8 | count:u8 and every reader decodes through unpack(); routers reject max_tokens_per_rank above 65536. - Add token_back_mode="hybrid_warps". - Size the mixed-CGA fallback group table for every slot that can split under PDL. - Fence the Rubin FC2 generic-proxy pool stores before fc2_done. TensorRT-LLM's own edits to the copy (the SwiGLU alpha/beta port from NVIDIA#17956, the NVIDIA#19960 fc12_scheduler change, one comment and the bandit annotations) are kept. New upstream lines that compare token_* names to string literals carry the same inline "# nosec B105" as the existing ones. No TensorRT-LLM caller needs a change. Signed-off-by: jintaop <jintaop@nvidia.com>
|
FYI Repair bot mentioned this PR in https://nvbugspro.nvidia.com/bug/6448152; it came up with #20079 . |
The 4 Kimi-K3 AgentX configs ran only as gen_only_no_context, because their DWDP16 ctx side could not start: Kimi K3 MoE raised NotImplementedError for DWDP at model init. Since NVIDIA#19960 Kimi K3 supports DWDP on the CUTEDSL MoE backend, which these configs use, so the ctx_only lanes can run. Add them back as they were held back in NVIDIA#20163: - l0_gb300_multi_nodes_perf_sanity_node4_gpu16: the 4 ctx_only ids, each the DWDP16 ctx side as one 16-GPU attention-DP server on 4 nodes. - GB300-16_GPUs-4_Nodes-PyTorch-PerfSanity-Node4-GPU16-Post-Merge, 4 splits, one test per split. The comments in the two gen_only_no_context lists now point at the new list instead of saying the ctx side cannot start. Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
…uce past fused-comm MegaMoE Backport the shared-expert all-reduce ordering from NVIDIA#19960 (e88d19c) to release/1.3. With MEGAMOE_CUTEDSL under TEP, the fused-comm kernel runs its own cross-rank exchange while the shared-expert all-reduce ran concurrently on the aux stream, which deadlocks at CUDA-graph warmup. The shared all-reduce now waits for the routed MoE. Only this ordering change and its unit tests are taken; the rest of NVIDIA#19960 is Rubin performance work and is not needed on release/1.3. Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
The 4 Kimi-K3 AgentX configs ran only as gen_only_no_context, because their DWDP16 ctx side could not start: Kimi K3 MoE raised NotImplementedError for DWDP at model init. Since NVIDIA#19960 Kimi K3 supports DWDP on the CUTEDSL MoE backend, which these configs use, so the ctx_only lanes can run. Add them back as they were held back in NVIDIA#20163: - l0_gb300_multi_nodes_perf_sanity_node4_gpu16: the 4 ctx_only ids, each the DWDP16 ctx side as one 16-GPU attention-DP server on 4 nodes. - GB300-16_GPUs-4_Nodes-PyTorch-PerfSanity-Node4-GPU16-Post-Merge, 4 splits, one test per split. The comments in the two gen_only_no_context lists now point at the new list instead of saying the ctx side cannot start. Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
Move the cutedsl-megamoe vendor from bangyus/cutedsl_megamoe main 382ce4a6 to main 7832a330. The selected file set is unchanged. The lock and compatibility patch were updated only with scripts/vendor_sources.py: the existing patch no longer applies to 7832a330, so the destination was set to the exact upstream selection and pinned with "pin" (which drops a patch that cannot apply when the destination is exact upstream), and the TensorRT-LLM compatibility edits were then re-applied and recorded with "patch create". Upstream commits that touch the vendored files: - 43af6d6c Report deterministic router overflow group-wide (token_comm_deterministic.py; merged via 822e739b) - d921a6b6 router: partition the metadata push by route index (MR !78) (token_comm.py) - 13434224 publish fc1/fc2 done with red.async.release (epi_async_release; Blackwell fc12 epilogue and MegaMoE kernel) - bd19a17b Blackwell bf16 swapab kernel for training forward pass (BF16 wire, token_in_stage_split, external_dispatch_pool in token_comm.py and token_comm_deterministic.py) - ce9173db Fix GenPhase workspace reset ordering (Rubin genphase MegaMoE kernel) - 76676a54 FC1 per-token activation scale for the Blackwell nvfp4 MegaMoE path (opt-in; also adds gate_activation="quick_geglu" and the megamoe_aot trailing optional argument) Compatibility patch, re-applied on 7832a330 (TensorRT-LLM-only): - SwiGLU swiglu_alpha/swiglu_beta support in the Blackwell and Rubin MegaMoE kernels and epilogues (MiniMax-M3). The Blackwell epilogue now derives its sigmoid exp2 constant from a quick_geglu scale; swiglu_alpha sets that scale, giving the same -alpha * log2e constant as before, and gate_activation="quick_geglu" is rejected together with SwiGLUBias constants, as SiTU already is. - "# nosec B105" on token_* region names and mode-string comparisons for bandit. The new upstream code needs no additional annotations. - Removal of "if stream_ends_before_target: fc1_exhausted = Boolean(True)" in PhaseInterleavedFc12Scheduler, as on TensorRT-LLM main (NVIDIA#19960). - Removal of the perf-number comment in helpers/topk_reduce.py. TensorRT-LLM integration needs no adaptation. The new descriptor keys (gate_activation, fc1_activation_per_token_scale, epi_async_release, token_in_stage_split, external_dispatch_pool) and the trailing fc1_activation_per_token_scale kernel argument are optional, and TensorRT-LLM does not set them. Blackwell MegaMoE and the shared FC12 kernel therefore use the upstream default epi_async_release=True, which requires epilogue flag batches <= 4; every TensorRT-LLM tactic uses (1, 1), (1, 4) or (2, 4). Workspace sizes are unchanged for TensorRT-LLM configurations. Signed-off-by: jintaop <jintaop@nvidia.com>
Remove the cutedsl-megamoe and megamoe-scheduler entries from 3rdparty/vendor_sources.lock.yaml, together with 3rdparty/vendor_patches/cutedsl-megamoe.patch. Both entries pointed at internal GitLab repositories, which the public repository should not reference. The lock is now identical to main. The sources under tensorrt_llm/_torch/cute_dsl_kernels/cutedsl_megamoe and megamoe_scheduler are unchanged and are maintained in-tree, as cutedsl_megamoe already is on main. They come from cutedsl_megamoe main 7832a330 plus the TensorRT-LLM edits the patch carried (SwiGLU alpha/beta, bandit B105 annotations, the NVIDIA#19960 fc12_scheduler change and one comment edit), and from the HALO-Q scheduler at 4dc86160. The ruff exclusion comment no longer says the sources are pinned. Signed-off-by: jintaop <jintaop@nvidia.com>
Dev Engineer Review
The inspected diff contains import-formatting changes in three Python files. It does not show runtime behavior, configuration, API, or test-list changes. The broader Kimi K3 and Rubin feature claims in the supplied objectives are not supported by this diff.
QA Engineer Review
No test changes.
Per-File QA Perspective
tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py: Import statements were reformatted. No observable behavior change appears in the inspected diff.tensorrt_llm/_torch/pyexecutor/_util.py: Import statements were reformatted. No observable behavior change appears in the inspected diff.tensorrt_llm/llmapi/llm_args.py: Import statements were reformatted, including moving the same Pydantic imports into a grouped import. No observable behavior change appears in the inspected diff.Description
Based on main
ff7ea92dfb.No longer stacked. #19959 has merged (
ff7ea92dfb); this branch now holds only its own 23 commits on top of main.Kimi K3 work for Rubin (SM107).
_Fp8BlockScaleWeightReadLinearpacks K32 R128c4 UE8M0 scales and runscute_dsl_mxfp8_gemm_rubinwith new K3 fine-grained low-M tuning buckets (fine_grained_m). SM100/SM103 keep DeepGEMM. Addsforward_prequantized.prime_inner_tactics), so the epilogue-keyed FC12 runner no longer raises TypeError in autotuner warmup. Kimi K3 acceptsmoe_config.backend: CUTEDSL_FC12.compact_packinginsubmit_dwdp.py. Needs [None][feat] Rubin merge-back: SM107 MoE, CFT release op, MegaMoE multi-node bootstrap, core runtime fixes #19183 for thedwdp/setup.pypart.TRTLLM_KDA_MTP_BF16_MATH=1, off by default). The replay caches becomekda_k_cache(bf16) +kda_g_cache(fp32) + bf16kda_v_cache/kda_beta_cache/ conv caches. bf16 and fp32 state pools are both accepted. SM107 is enabled for the optimized KDA kernels. The mixer now uses the kernel's fused attention-residual epilogue: packed token layout, gated RMSNorm in the epilogue (fuse_output_norm), and on SM107, for verify-only batches outside the breakable CUDA graph, an MXFP8 core with R128c4 scales that goes straight too_proj.forward_prequantized(Rubin CuTe MXFP8 GEMM). Without the output-gate section or finalized o_norm weights, the previous launch with the Python output gate is kept as the fallback.REPLAY_ONLY: the chunk is the accepted drafts, only the state is stored), andkda_mtp_commit_pending_drafts,commit_kda_pending_draftsand the V2 manager's_commit_kda_pending_draftsread the split caches. The verify after a resume starts a new WY-form chunk, so it matches an unsuspended run to the kernel's accuracy rather than bit for bit; the conv windows and replay caches stay bit-exact.ceil(H * S / 128)). Non-persistent only. The CUDA-graph workspace is sized once for every batch bucket, in 128-row tiles.TLLM_MOE_ASYNC_INPUT_QUANT).RMS_NORMgets MNNVL support without a residual. Other strategies fall back.trtllm::dsv3_router_latent_gemm_op), SM107, TP MEGAMOE_CUTEDSL.input_ready_eventthat ConfigurableMoE and the schedulers join at the first read ofx. The FC12 op zeroes its counters with one fill.AUTO). About 36% faster in the drafter region.TLLM_DRAFT_KV_GPU_BUDGET_GIBcaps the draft KV GPU budget on disaggregated generation workers and gives the excess to the target pool. It never goes below the draft's allocator floor and does nothing when unset.block_split_kvs; a request planned onto one split stores its output directly and the reducer skips its rows.test_kimi3.py::TestKimiK3::test_gsm8k_nvfp4_dep8with a gsm8k reference row. It runs withKIMI_K3_FP8_WEIGHT_READ_MOE_MLP=1(passed asenv_overrides): attention DP replicates the shared-expert and latentMoE MLPs, and in BF16 they leave DEP8 no KV-cache room. The reference was measured with this cast on.
Not included:
RMS_NORM_QUANT_FP8_BLOCKSCALE. Nothing uses it.fladependency. Main has both since [None][fix] Kimi K3 / KDA / MNNVL / DFlash: fixes for defects on main #19988 (_scratch_ct,fla-coreinrequirements.txt).ws_statsdouble buffer and slot-release__syncwarp. Main has them, pluscross-proxy fences, since [None][fix] Kimi K3 attn_res kernels: order the ws_stats reads and fence the slot releases #19829.
Test Coverage
tests/unittest/_torch/thop/parallel/test_kimi_k3_fp8_weight_read_linear.py(incl.test_checkpoint_pair_carries_cute_scale, Rubin)tests/unittest/_torch/moe/test_kimi_k3_situ_moe.py(incl.test_cutedsl_fc12_survives_autotune_warmup, SM107)tests/unittest/_torch/moe/test_moe_backend.py(incl.test_fc1_prologue_wait_preserves_exhaustion, SM107)tests/unittest/_torch/moe/test_kimi_k3_mlp.py:test_kimi_k3_shared_expert_parallel_constructiontest_kimi_k3_shared_allreduce_orderingtest_kimi_k3_latent_down_projection_overlaps_routingtests/unittest/_torch/thop/parallel/test_cute_dsl_moe.py: priming gate, FC12 warmup preparation, async input quantizationtests/unittest/_torch/thop/parallel/test_dsv3_router_gemm.py: 896 experts, top-k equality, fused router+latent optests/unittest/_torch/multi_gpu/test_mnnvl_allreduce.py::test_mnnvl_rms_norm_fusion_without_residualtests/unittest/_torch/attention/test_cute_dsl_mla.py: FP8 scales, split-KV sizing, MLA generation routing for FP8 wide-head verify groupstests/unittest/_torch/attention/test_cute_dsl_mla_split_plan.py: per-request split plantests/unittest/_torch/executor/kv_cache/test_kv_cache_budget_split.py: draft KV GPU budget cap, separate draft page sizetests/unittest/_torch/speculative/hw_agnostic/test_kimi_k3_dspark_semantics.py: DSpark drafter defaultstests/unittest/_torch/attention/test_cute_dsl_mla_helix.pytests/unittest/_torch/modules/kimi_kda/:test_kda_mtp_decode_cute_parity.py,test_kimi_kda_fused_verify_parity.py(epilogue arguments, unfused fallback, MXFP8 gating, SM107 MXFP8-vs-BF16),test_kimi_kda_bf16_state_pool.py; the replay-only commit intest_kda_mtp_decode_cute_parity.pytests/unittest/_torch/executor/kv_cache/test_mamba_cache_manager.pytests/unittest/_torch/speculative/hw_agnostic/test_sa.pytests/unittest/_torch/executor/test_pytorch_model_engine_warmup.py: Helix CP generation-only autotuner warmuptests/unittest/_torch/misc/test_autotuner.py: PARALLEL tactics split across the Helix TP×CP grouptests/integration/defs/accuracy/test_kimi3.py::TestKimiK3::test_gsm8k_nvfp4_dep8Validation results
K3 disaggregated DSpark, GSM8K (DEP16 context + DEP16 generation, FP8 KV cache, DSpark with 7 drafts)
cute_dsl_mla_decode_fp8.K3 disaggregated perf gate (SM107, Helix CP8 generation-only, concurrency 16, MTP5) at d5ca963: all 6 gates pass against the baseline.
test_helix_cp_runs_only_the_generation_autotuner_warmupand of the multi-rank Helix TP×CP tuning.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.