[#15791][fix] Enable SM120 skip-softmax FMHA support probe - #15759
[#15791][fix] Enable SM120 skip-softmax FMHA support probe#15759mihai-chiorean wants to merge 3 commits into
Conversation
Signed-off-by: Mihai Chiorean <mihai.v.chiorean@gmail.com>
📝 WalkthroughWalkthroughAdds a compile-time-guarded helper Skip-softmax SM120 bridge support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/tensorrt_llm/kernels/contextFusedMultiHeadAttention/fused_multihead_attention_v2.cpp (1)
56-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the SM120 bridge eligibility matrix in one place.
This helper is now a second copy of the bridge routing predicate in
run(). The current PR fixes one drift between support detection and dispatch, but the next capability tweak can desynchronize them again. Please route both paths through one shared predicate and keep only the runtime-only checks (flash_attention,interleaved, softmax-stats pointer) outside it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/tensorrt_llm/kernels/contextFusedMultiHeadAttention/fused_multihead_attention_v2.cpp` around lines 56 - 72, The SM120 bridge eligibility logic is duplicated between isSupportedBySkipSoftmaxSm120Bridge and the routing in run(), which can drift over time. Refactor both paths to use one shared predicate for the capability matrix, and leave only runtime-only checks such as flash_attention, interleaved, and the softmax-stats pointer in the dispatch path. Keep the shared eligibility logic centralized in the helper and have run() call it directly instead of re-encoding the same conditions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@cpp/tensorrt_llm/kernels/contextFusedMultiHeadAttention/fused_multihead_attention_v2.cpp`:
- Around line 56-72: The SM120 bridge eligibility logic is duplicated between
isSupportedBySkipSoftmaxSm120Bridge and the routing in run(), which can drift
over time. Refactor both paths to use one shared predicate for the capability
matrix, and leave only runtime-only checks such as flash_attention, interleaved,
and the softmax-stats pointer in the dispatch path. Keep the shared eligibility
logic centralized in the helper and have run() call it directly instead of
re-encoding the same conditions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d87717dc-aee5-411f-a161-7ec217bf6d46
📒 Files selected for processing (1)
cpp/tensorrt_llm/kernels/contextFusedMultiHeadAttention/fused_multihead_attention_v2.cpp
Signed-off-by: Mihai Chiorean <mihai.v.chiorean@gmail.com>
|
Datapoint from an RTX PRO 6000 (SM120, x86_64, CUDA 13.0): I built current main (e4aba85) bare-metal with Your validation was on |
|
Independent SM120 A/B result on public Environment
Results
The probe was a real C++ driver linked against the locally built The stock SM120 build already generates BF16 causal PACKED_QKV metadata for head dimensions 128 and 256. Since Recommendation: close PR #15759 as unnecessary on current |
|
Careful with my 07-04 datapoint - I don't think it supports closing this. On sm_120 the bf16 causal PACKED_QKV path is a hand-written bridge ( That also makes the A/B non-discriminating: #15759 short-circuits |
|
Thanks for the investigation. I reran the validation on clean builds with #15759 absent. Results:
The earlier subset-hash probe was not sufficient by itself, but these clean production-path runs exercise the actual serving path and do not reproduce the reported failure. I’m therefore closing this PR as unnecessary on current main. |
Fixes #15791
Summary
checkIfKernelExist()to recognize the guarded SM120/SM121 BF16 causalPACKED_QKVbridge path.TLLM_ENABLE_SKIP_SOFTMAX_SM120and limited to the already-linked handwritten SM120 bridge; this does not add a new kernel.Test Coverage
git diff --checkgit diff --cached --checkvalidate-blockers-811cc0732@df113db388332ea665efe9133fb0194abb18e3cd: FMHA missing warnings11 -> 0; unfused fallback warnings11 -> 0; max attention workspace~13.4 GB -> ~100 MB; batch 1 TPOT18.37 -> 17.09 ms; batch 8 TPOT33.06 -> 32.55 ms; output coherent./tmp/sm120_fmha_build_20260629_222414.log; before/after logs:/tmp/sm120_fmha_before_batch_20260629_222045.log,/tmp/sm120_fmha_after_batch_20260629_225519.log.