Repository navigation
[None][perf] Enable configurable MLA skip correction for TRT-LLM Gen FMHA - #18118
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 WalkthroughThe change adds a zero-default skip-correction threshold to attention configuration and FMHA runner parameters. ChangesSkip-correction threshold propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change adds an opt-in skip-correction optimization while preserving existing behavior by default; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
fe18020 to
8771366
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
/bot run --disable-fast |
|
/bot run --disable-fail-fast |
|
PR_Github #68717 Bot args parsing error: usage: /bot [-h] |
|
PR_Github #68718 [ run ] triggered by Bot. Commit: |
|
PR_Github #68718 [ run ] completed with state
|
8771366 to
1cc52b2
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
1cc52b2 to
f175030
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #68983 [ run ] triggered by Bot. Commit: |
f175030 to
8afe4ad
Compare
kris1025
left a comment
There was a problem hiding this comment.
Approved for the cubins update.
|
PR_Github #68983 [ run ] completed with state
|
|
PR_Github #70354 [ run ] completed with state
|
schetlur-nv
left a comment
There was a problem hiding this comment.
Approving for oss-compliance
b7e3890 to
75677d1
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #70625 [ run ] triggered by Bot. Commit: |
75677d1 to
9027d28
Compare
|
/bot run |
|
PR_Github #70667 [ run ] triggered by Bot. Commit: |
|
/bot run |
9027d28 to
7492bf9
Compare
|
PR_Github #70625 [ run ] completed with state |
|
PR_Github #70668 [ run ] triggered by Bot. Commit: |
|
PR_Github #70667 [ run ] completed with state |
|
PR_Github #70668 [ run ] completed with state
|
Signed-off-by: yunruis <205571022+yunruis@users.noreply.github.com>
7492bf9 to
25004c1
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #70865 [ run ] triggered by Bot. Commit: |
|
PR_Github #70865 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71103 [ run ] triggered by Bot. Commit: |
|
PR_Github #71103 [ run ] completed with state |
Description
This PR exposes threshold-based skip correction for the TRT-LLM Gen MLA FMHA path through the TRT-LLM runtime and
TorchLlmArgs. The optimization is opt-in and disabled by default, so existing inference behavior is unchanged unless users explicitly enable it.The required TRT-LLM Gen kernel/export changes are already present on
mainthrough6c1ce33e7fbb1730c3d85150e6ac73ebc1b76deb. This PR reuses those assets and contains only the TRT-LLM runtime, configuration, validation, and test integration needed to activate the feature.Scope relative to
mainThis branch does not regenerate or modify the TRT-LLM Gen exported artifacts already available on
main, including:trtllmGen_fmha_exportgenerated interfacescuda_ptx.handkernelMetaInfo.hThe remaining changes under
trtllmGenKernels/fmhaare runtime glue: they pass the configured threshold into the existing generated kernels, validate it against the selected BMM2 dtype, and apply the correct softmax scale in the separate reduction path.The PR is a single signed commit on top of the latest
main.User-facing configuration
enable_skip_correction: enables the optimization; defaults toFalse.skip_correction_threshold: controls the base-2 row-max threshold; defaults to8.0and accepts values in(0, 32].8for E4M3,15for FP16, and32for BF16.attn_backend="TRTLLM".0.0, preserving the existing FMHA behavior.Example configuration:
Omit
skip_correction_thresholdto use the default value of8.0.Implementation
TorchLlmArgs,ModelConfig, MLA construction, FMHA backend selection, the Python/C++ attention operator, and the TRT-LLM Gen FMHA runner.FallbackFmha.Impact and compatibility
Test Coverage
Feature-path tests explicitly enable skip correction; existing tests continue to exercise the disabled/default behavior.
Added coverage
tests/unittest/llmapi/test_llm_args.pytests/unittest/_torch/attention/test_attention_mla.pytests/unittest/_torch/attention/sparse/test_sparse_mla_forward.pytests/integration/defs/accuracy/test_llm_api_pytorch.pyValidation results
--parallel 224).make -j224).379 passed.22 passed.2 passed.30 passed.95.262accuracy versus95.110reference.CI Failure Analysis
The previous
L0_Test-x86_64-Multi-GPUfailure was:accuracy/test_disaggregated_serving.py::TestNemotron3Super120B::test_ctx_dp2_gen_tp4This case does not use the MLA path changed by this PR, and skip correction is disabled by default. Recent CI history also shows the same accuracy-boundary failure on unrelated PRs, while post-merge runs passed. It is therefore classified as an existing flaky accuracy case rather than a regression from this change.
This PR does not add or modify any waiver for that test.
PR Checklist
main.api-compatible.