Repository navigation
[https://nvbugs/6691772][fix] Update trtllm-gen fmha autotuner to enable 96 head MLA (cherry-pick #18599) - #20469
Conversation
…ble 96 head MLA (NVIDIA#18599) Signed-off-by: Pengbo Wang <[email protected]> (cherry picked from commit 4dee061) Signed-off-by: Pengbo Wang <[email protected]>
|
/bot run |
|
@yihwang-nv, could you help to review this PR as trt-llm-torch-attention-devs? Thanks~ Assignment explanation
Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once. |
|
PR_Github #78452 [ run ] triggered by Bot. Commit: |
|
PR_Github #78452 [ run ] completed with state |
brnguyen2
left a comment
There was a problem hiding this comment.
Approving — the comments below are optional touch-ups, not blockers.
The backport matches main, and the FMHA artifacts it depends on (#19956) are on release/1.3. Two things before merge:
-
Run GPU CI on this branch. The description says GPU tests have not been rerun on the backport. release/1.3 and main differ in FMHA artifacts and selection code, so main's B200 results don't carry over.
test_trtllm_mla_kimi_k3_h96runs under theunittest/_torch/attentionentries inl0_b200.yml/l0_b300.yml, so a/bot runcovers it. Please also check that an FP8-KV H96 decode at batch < 8 now goes to the legacy TRTLLM-Gen path. That route is new with this PR (the old threshold was 1), and the new regression test doesn't cover it: the test is bf16 and excludes CuTe DSL fromTLLM_FMHA_LIBS. -
The comment on the helix carve-out is now outdated. At
[tensorrt_llm/_torch/attention/backends/fmha/cute_dsl_mla.py:321](https://github.com/NVIDIA/TensorRT-LLM/pull/20469/files#diff-c21c22ced2fdb7e5b7eed564c2e124bae7c684c997fdeb7ade581ff77654d448R321), it says "TRTLLM-Gen rejects 64 < num_heads_q < 128 outright", and gives that as the reason helix H96 multi-token verify skips the perf gate. With this PR, the legacy TRTLLM-Gen path serves H96 Q3, and the new test covers it. Either update the comment to the actual reason the carve-out stays (for example, the helix softmax-stats requirement), or decide whether the carve-out is still needed. Otherwise a later reader will go by the outdated reason.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
@yuxianq, thanks for picking up this PR! I’ve handed off the trt-llm-torch-attention-devs review from @yihwang-nv to you. The 4 attention-review points now belong to @yuxianq; @yihwang-nv’s attention reservation has been released. Your review is already submitted, so the points count as completed work; no new review request was added. @yihwang-nv, no further attention review is requested from you. Thanks~ |
Description
Cherry-pick 4dee061 from main (#18599) to release/1.3.
Enable Kimi K3 H96 MLA through the updated legacy TRTLLM-Gen path, reject unsupported FlashInfer TRTLLM-Gen head counts, and update CuTe DSL selection and regression coverage.
The required FMHA artifacts are already included in release/1.3 via #19956. No cubins or static libraries are changed.
Resolved one comment-only conflict in modeling_kimi_linear.py, preserving the release branch's cache-manager description.
Test Coverage
PR Checklist
GitHub Bot Help
Available CI commands:
/bot help.Dev Engineer Review
64 < num_heads < 128away from FlashInfer TRTLLM-Gen. The fallback is the updated legacy TRTLLM-Gen path, which enables Kimi K3 H96 MLA. This range also includes H80, so verify that fallback support and performance are acceptable for other models in the range.tokens_per_block: 64, but describe it as a validated setting rather than a hard requirement. The default remains unchanged.QA Engineer Review
tests/unittest/_torch/attention/test_attention_backends.pyaddstest_trtllm_mla_kimi_k3_h96;tests/unittest/_torch/attention/test_fmha_page_index.pyadds mixed-batch, unsupported-head-range, and range-boundary checks, and updates existing gate-test inputs.bfloat16; it is gated to SM100/SM103 and exercises TRTLLM backend selection. The page-index tests verify CuTe DSL mixed-batch rejection and FlashInfer TRTLLM-Gen head-count gating.tests/integration/test_lists/test-db/ortests/integration/test_lists/qa/. These are unit tests, not integration tests; the existing Kimi K3 integration harness has no corresponding test-list change.Per-File QA Perspective
docs/source/deployment-guide/deployment-guide-for-kimi-k3-on-trtllm.md— Clarifies that 64 is validated, not a current hard requirement. QA should verify that instructions match the supported page-size behavior.examples/kimi_k3/disagg/README.md— Separates current constraints from the historical page-size reason. No runtime setting changed.examples/kimi_k3/disagg/benchmark_kimi_k3_dep16.yaml— Comments change only;tokens_per_blockremains 64.examples/kimi_k3/disagg/ctx_config.yaml— Comments change only; cache and scheduler settings remain unchanged.examples/kimi_k3/disagg/gen_config.yaml— Comments change only;tokens_per_blockremains 64.examples/kimi_k3/disagg/gen_config_no_sa.yaml— Comments change only;tokens_per_blockremains 64.tensorrt_llm/_torch/attention/backends/fmha/cute_dsl_mla.py— H96 Q1 decode uses an increased batch threshold, and mixed context/generation batches now decline CuTe DSL for every head count.tensorrt_llm/_torch/attention/backends/fmha/flashinfer_trtllm_gen.py— The support check now acceptsnum_headsand declines H65–H127 MLA generation so selection can use the legacy backend.tensorrt_llm/_torch/models/modeling_kimi_linear.py— Updates the default-setting rationale;tokens_per_block=64remains unchanged.tests/integration/defs/kimi_k3_sa_harness.py— Updates the rationale for the established page size. The integration harness still uses 64.tests/unittest/_torch/attention/test_attention_backends.py— Adds an SM100/SM103 H96 Kimi K3 regression for Q1/Q3 and page sizes 32/64. No matching entry was found in the integration test lists.tests/unittest/_torch/attention/test_fmha_page_index.py— Adds mixed-batch and head-range checks, and updates existing support-gate test inputs. No matching entry was found in the integration test lists.