Repository navigation
Conversation
43a4124 to
c1400ba
Compare
|
/bot run |
|
PR_Github #79102 [ run ] triggered by Bot. Commit: |
|
PR_Github #79102 [ run ] completed with state
|
c1400ba to
5a3dd8b
Compare
|
/bot run --disable-fail-fast |
5a3dd8b to
9fe0dfb
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #79290 [ run ] triggered by Bot. Commit: |
|
PR_Github #79290 [ run ] completed with state
|
9fe0dfb to
cf8a77e
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #79640 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast |
|
PR_Github #79640 [ run ] completed with state
|
|
MiniMax-M3 on VR200 (sm_107): two small findings from a correctness bisect of this PR's context path We bisected sporadic near-uniform next-token distributions on VR200 with this PR applied (r3 wheel: main +
Happy to share the standalone repro ( |
|
fmha_sm100 dense FP8 prefill returns NaN when a recycled partial page holds FP8 NaN bytes past kv_len (FA4 path is This PR's
|
|
/bot run --disable-fail-fast |
👎 Promotion blocked, new vulnerability foundVulnerability report
|
Reject unsupported OAI locality execution and pre-scaled FP4 handoffs, preserve activation offsets and refit cache allocations, release stale CLC weight arguments, and validate native input devices. Keep scheduler starvation caps and release the optional reserve for indivisible chunks. Add focused routing, FA4 geometry, refit, and rejection regressions plus explicit Rubin CI registrations. Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Preserve requested-device plan synchronization and compatible split outputs. Keep draft admission within the optional append reserve and avoid non-consuming decode-graph MXFP8 placeholders. Repair CI fixtures and runtime import isolation; retain all router BF16 terms while using exact operand promotion for TF32 MMA, with synchronized launch diagnostics and unchanged accuracy gates. Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
…d reserves Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
…ier shapes Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
bdba755 to
dc2f5c4
Compare
|
/bot run --disable-fail-fast --extra-stage "GR100-PyTorch-Post-Merge-1" |
|
PR_Github #83136 [ run ] triggered by Bot. Commit: |
|
PR_Github #83136 [ run ] completed with state
|
Dev Engineer Review
The changes add SM107-specific MiniMax-M3 prefill paths across QKV projection and cache production, sparse and dense attention, normalization and quantization, MXFP8 GEMMs, MoE routing and finalization, and context scheduling. New CUDA operators and CuTe DSL kernels have runtime gates and fallback paths. The patch also adds Rubin serving configurations and a patched FA4 setup script.
Review should focus on numerical and cache correctness at optimization boundaries. The reported FA4 accuracy miss for a short chunk over a long prefix, selector-test abort on SM107, and NaNs in
fmha_sm100when reused partial KV pages contain stale FP8 V values are follow-up risks; the supplied reports do not establish that they are resolved. Several paths also change reduction order, use deterministic MoE finalization, or skip intermediate BF16 writes, so their numerical bounds, stream use, and fallback behavior need validation. SM107 GPU coverage is registered inl0_gr100, but the supplied objective says no SM107 GPU CI stage exists.QA Engineer Review
The diff changes 107 files. It adds and modifies unit tests and updates two
test-dblists. The CPU list adds CPU-compatible routing, dispatch, contract, and configuration checks. Thel0_gr100list adds Rubin GPU tests for context kernels, attention, quantization, routing, MoE, and GEMM paths. No manual-QA list changes appear in the supplied diff. Test-list registration is present for the listed integration tests; the supplied evidence does not establish completed test or CI results. Coverage verdict: needs follow-up, particularly for reported FA4 accuracy, selector abort, and partial-page stale-V NaNs.Per-File QA Perspective
Source, kernels, operators, and configuration
3rdparty/patches/fa4_fp8_rescale0.patch3rdparty/patches/msa_strided_paged_kv.patchcpp/tensorrt_llm/kernels/customAllReduceKernels.cucpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cucpp/tensorrt_llm/kernels/minimaxM3/routerGemv.cucpp/tensorrt_llm/kernels/minimaxM3/routerGemv.hcpp/tensorrt_llm/kernels/minimaxM3/selectPrefillTile.cucpp/tensorrt_llm/kernels/minimaxM3/selectPrefillTile.hcpp/tensorrt_llm/kernels/minimaxM3Sm107Tp2/ctxResidualRmsNormMxfp8.cucpp/tensorrt_llm/kernels/minimaxM3Sm107Tp2/ctxResidualRmsNormMxfp8.hcpp/tensorrt_llm/thop/minimaxM3/minimaxM3RouterGemvOp.cppcpp/tensorrt_llm/thop/minimaxM3/minimaxM3SelectPrefillTileOp.cppcpp/tensorrt_llm/thop/minimaxM3/minimaxM3Sm107Tp2CtxNormMxfp8Op.cppcpp/tensorrt_llm/thop/mxfp8Gemm.cppexamples/minimax_m3/rubin/README.mdexamples/minimax_m3/rubin/agg/README.mdexamples/minimax_m3/rubin/agg/agg_c14.yamlexamples/minimax_m3/rubin/agg/agg_c20.yamlexamples/minimax_m3/rubin/agg/agg_c46.yamlexamples/minimax_m3/rubin/agg/agg_c56.yamlexamples/minimax_m3/rubin/agg/agg_env.shexamples/minimax_m3/rubin/ctx_agentx_c24.yamlexamples/minimax_m3/rubin/fp4_moe_tactics_tp2ctx_v1.jsonexamples/minimax_m3/rubin/setup_fa4.shtensorrt_llm/_torch/_experimental/modeling_v2/models/minimax_m3/kernels/fake_ops.pytensorrt_llm/_torch/_experimental/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp2/modeling.pytensorrt_llm/_torch/attention/backends/fmha/drafter_last_row.pytensorrt_llm/_torch/attention/backends/fmha/flashinfer_trtllm_gen.pytensorrt_llm/_torch/attention/backends/fmha/msa_combine_mxfp8.pyo_proj. Verify skipped BF16 writes only occur when the consumer takes the slot.tensorrt_llm/_torch/attention/backends/fmha/msa_prefill.pytensorrt_llm/_torch/attention/backends/fmha/registry.pytensorrt_llm/_torch/attention/backends/sparse/minimax_m3/kernels/msa_utils.pytensorrt_llm/_torch/attention/backends/sparse/minimax_m3/msa_backend.pytensorrt_llm/_torch/attention/backends/sparse/minimax_m3/msa_indexer.pytensorrt_llm/_torch/custom_ops/cpp_custom_ops.pytensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.pytensorrt_llm/_torch/custom_ops/torch_custom_ops.pytensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.pytensorrt_llm/_torch/kernels/rubin/m3_qkv_fusion/__init__.pytensorrt_llm/_torch/kernels/rubin/m3_qkv_fusion/clc_tile_scheduler.pytensorrt_llm/_torch/kernels/rubin/m3_qkv_fusion/kernel.pytensorrt_llm/_torch/kernels/rubin/m3_qkv_fusion/plain_gemm.pytensorrt_llm/_torch/models/modeling_minimaxm3.pytensorrt_llm/_torch/modules/linear.pytensorrt_llm/_torch/modules/m3_ctx_clc_gemm.pytensorrt_llm/_torch/modules/swiglu.pytensorrt_llm/_torch/moe/fused_moe/cutedsl/grouped_gemm/eligibility.pytensorrt_llm/_torch/moe/fused_moe/cutedsl/grouped_gemm/nvfp4.pytensorrt_llm/_torch/moe/fused_moe/router_gemm.pytensorrt_llm/_torch/moe/fused_moe/unpermute_residual.pytensorrt_llm/_torch/moe/kernels/rubin/rubin_contiguous_gather_grouped_blockscaled_gemm_act_fusion.pytensorrt_llm/_torch/moe/kernels/rubin/rubin_contiguous_grouped_blockscaled_gemm_finalize_fusion.pytensorrt_llm/_torch/pyexecutor/resource_manager.pytensorrt_llm/_torch/pyexecutor/scheduler/scheduler_v2.pyTest-list files
tests/integration/test_lists/test-db/l0_cpu.ymltests/integration/test_lists/test-db/l0_gr100.ymlTest-code files
tests/unittest/_torch/attention/fmha/test_msa_combine_mxfp8.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_fa4_setup.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_fmha_sm107_gates.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_dense_prefill_fa4.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_dense_prefill_fa4_arch.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_dense_prefill_fa4_patched.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_prefill_v_tail.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_proxy_nofill.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_sparse_attn_decode.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_minimax_m3_tile_select.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_msa_backend.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_msa_k2q_ws_stream.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_msa_per_token_valid_blocks_numpy.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_msa_prefill_nvfp4_out_in_place.pyl0_gr100.tests/unittest/_torch/attention/sparse/msa/test_msa_proxy_few_rows_kv_splits.pyl0_gr100? No.tests/unittest/_torch/attention/sparse/msa/test_msa_q_e4m3.pyl0_gr100.tests/unittest/_torch/attention/test_drafter_kv_tail_zero.pyl0_gr100.tests/unittest/_torch/attention/test_flashinfer_trtllm_gen_sm107_p128.pyl0_gr100? No.tests/unittest/_torch/kernels/parallel/test_mxfp8_mxfp8_gemm.pyl0_gr100.tests/unittest/_torch/kernels/parallel_hw_agnostic/test_minimax_m3_nvfp4_horizontal_producer.pyl0_gr100.tests/unittest/_torch/kernels/serial/test_m3_ctx_clc_gemm.pyl0_gr100.tests/unittest/_torch/kernels/serial/test_m3_ctx_fused_quant.pyl0_gr100.tests/unittest/_torch/kernels/serial/test_m3_qkv_contract.pyl0_cpu.yml.tests/unittest/_torch/kernels/serial/test_m3_qkv_fusion.pyl0_gr100.tests/unittest/_torch/kernels/serial/test_sm107_allreduce_rmsnorm_rows.pyl0_gr100.tests/unittest/_torch/misc/test_fp4_moe_tactic_table.pyl0_cpu.yml.tests/unittest/_torch/modeling/test_minimax_m3_router_fp32_cast.pyl0_gr100.tests/unittest/_torch/modeling/test_minimax_m3_router_tc_gen.pyl0_gr100.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp2/attention/test_modeling_v2_m3_draft_attention.pyl0_gr100? No.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp2/gemm/test_modeling_v2_m3_pinned_gemm.pyl0_gr100? No.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp2/test_modeling_v2_m3_capture_boundary.pyl0_cpu.yml.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp2/test_modeling_v2_m3_ctx_stack_route.pyl0_cpu.yml.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp4/attention/test_modeling_v2_m3_draft_attention.pyl0_gr100? No.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp4/gemm/test_modeling_v2_m3_mxfp8_pinned_gemm.pyl0_gr100? No.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp8/attention/test_modeling_v2_m3_draft_attention.pyl0_gr100? No.tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m3_nvfp4__sm_107__tp8/gemm/test_modeling_v2_m3_pinned_gemm.pyl0_gr100? No.tests/unittest/_torch/models/test_minimax_m3.pyl0_cpu.yml; the embedding selector is listed inl0_gr100.tests/unittest/_torch/models/test_minimax_m3_drafter_rows.pyl0_cpu.yml.tests/unittest/_torch/modules/test_m3_ctx_clc_dispatch.pyl0_cpu.yml.tests/unittest/_torch/modules/test_mxfp8_linear.pyl0_gr100.tests/unittest/_torch/modules/test_prequantized_mxfp8_streams.pyl0_gr100.tests/unittest/_torch/moe/test_cutedsl_rubin_deterministic.pyl0_gr100.tests/unittest/_torch/moe/test_cutedsl_swiglu_oai_resolution.pyl0_gr100.tests/unittest/_torch/moe/test_m3_fold_shared_finalize.pyl0_gr100? No.tests/unittest/_torch/moe/test_m3_router_tc_fp4_moe.pyl0_gr100.tests/unittest/_torch/moe/test_moe_impl.pyunittest/_torch/moedirectory inl0_cpu.yml.tests/unittest/_torch/moe/test_router_gemm.pyl0_gr100.tests/unittest/_torch/moe/test_unpermute_residual.pyl0_gr100.tests/unittest/_torch/peft/test_moe_lora_model_path.pyl0_gr100? No.tests/unittest/_torch/pyexecutor/kv_cache/test_kv_cache_v2_scheduler.pyl0_gr100? No.tests/unittest/_torch/pyexecutor/kv_cache/test_kv_connector_v2_prefix_real_manager.pyl0_gr100? No.Description
Depends on #20623 (Rubin decode targets, which depends on #20306). This PR adds only the last commit; please review that commit.
This PR speeds up the MiniMax-M3 NVFP4 context (prefill) worker on Rubin (sm_107). Changes are on by default and engage on sm_107 only; each change that alters numerics or adds a kernel has an environment kill switch, and other GPUs keep the stock path.
Performance
Cold prefill (no cached prefix) on the TP2 context worker (Rubin, MiniMax-M3 NVFP4, Eagle3): 1,807–1,902 ms at 165K tokens (43–46K tok/s/GPU), 3.9–4.1 s at 323K and 9.7–10.0 s at 650K, about 1.3× faster at 165K and 1.5× at 650K than an earlier stock-path image (measured on different nodes; indicative).
Projections and boundaries
kernels/rubin/m3_qkv_fusion,TRTLLM_CTX_QKV_FUSED): above 1024 rows one MXFP8 GEMM (2-CTA, CLC tile scheduler) runs the QKV/index projection and writes the NVFP4 K/V and FP8 index-K caches from its epilogue; breakable-graph buckets take it through an eager break.modules/m3_ctx_clc_gemm.py,TRTLLM_CTX_CLC_GEMM) for o_proj, the shared-expert gate_up and the dense MLP at ≥ 1024 rows.TRTLLM_CTX_NORM_MXFP8,TRTLLM_CTX_NORM_FP4): at ≥ 8192 rows the residual RMSNorm after the all-reduce also emits the next linear's MXFP8 input and the routed experts' NVFP4 input.TRTLLM_CTX_SWIGLU_MXFP8), and one-entry MXFP8 hand-off slots between producers and the consuming linear, kept out of compiled graphs.Attention
fmha/msa_prefill.py, killTRTLLM_MSA_DISABLE_DENSE_FA4); it needs flash-attn-4 4.0.0b19 with the FP8rescale_thresholdchange (3rdparty/patches/fa4_fp8_rescale0.patch, applied to a copy of the installed package byexamples/minimax_m3/rubin/setup_fa4.sh), and without it the dense layers keep fmha_sm100.TRTLLM_CTX_COMBINE_MXFP8), plus prefill tile selection, a segmented/split indexer proxy with SM-wide KV splits, and an in-place NVFP4 prefill output.TRTLLM_CTX_DRAFTER_LAST_ROW), o_proj/MLP only on the rows the draft loop reads (TRTLLM_CTX_DRAFTER_DEAD_ROWS), and the partial last page's K/V tails zeroed on private pages (TRTLLM_CTX_DRAFTER_KV_TAIL_ZERO).per_token_valid_blocksis one NumPy pass.3rdparty/patches/msa_strided_paged_kv.patch): two correctness fixes for every GPU (V tail zeroed pastkv_valid_cols,griddepcontrol.waitrestored); its performance changes are gated to sm_107 at runtime.MoE, router and scheduling
TLLM_CUTEDSL_MOE_DETERMINISTIC): FC2 per permuted row with a fixed-order unpermute, optionally folding the shared-expert output (TLLM_M3_MOE_FOLD_SHARED).TRTLLM_CTX_ROUTER_TF32_FIXED), and the TF32 tensor-core router for 9–16-row generation steps on the built-in model (TRTLLM_M3_ROUTER_TC_GEN). The context router GEMM splits K into 8 fixed slices up to 8192 rows.TLLM_CTX_APPEND_RESERVE=<tokens>): behind a long prefill a reserved token budget lets short appends join the same step, optionally shortest-first (TLLM_CTX_APPEND_RESERVE_SJF); unset, every model keeps the stock chunking.TLLM_FP4_MOE_TACTIC_TABLE).The sm_107 TP2 target (modeling_v2)
examples/minimax_m3/rubin/agg/.Numerics. Most items are bitwise equal to their off switch. The fused QKV GEMM, the CLC GEMM, the FA4 dense prefill, the deterministic MoE FC2, the TF32 routers and the router's split-K use a different reduction order: deterministic, but not bitwise to the stock kernels. All of them except the router split-K are chunk-size invariant; the TF32 router splits K only up to 8192 rows, so its reduction order changes at 8192 rows and router logits (and, at near-ties, the selected experts) can differ between chunks of at most 8192 rows and larger ones.
External dependencies. flash-attn-4 is pinned to 4.0.0b19:
setup_fa4.shchecks the FA4 file and the patch by SHA256. The MiniMax-M3 Rubin maintainers own it; an FA4 update re-derives the patch, re-runs the FP8 dense-prefill check and updates both pins, and the patch is dropped once FA4 ships the change.Test Coverage
attention/(fmha, sparse/msa incl. the sm_107 gate cells),models/test_minimax_m3.py,moe/,thop/serial/,modeling/, the sm_107modeling_v2TP2 / TP4 / TP8 target directories, and the scheduler's append-reserve tests, all passing.cpu_onlyand listed inl0_cpu.yml; the sm_107 GPU tests have no CI stage yet (no Rubin test list), and the TF32 router / unpermute / fold tests exercise paths used only on the sm_107 context worker, so they are not registered on other GPUs in this PR.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.