Repository navigation
Add fmha_v2 attention backend for SM90/120 - #23112
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
f8cbd73 to
3e4d3ca
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
28d1a77 to
605f578
Compare
|
@akhilg-nv could you fix the merge conflict? thanks! |
|
cc @b8zhong for vis |
|
@akhilg-nv could you fix the conflicts? thanks |
|
@akhilg-nv I agree with Po-Han here: #32272 (comment) By the way, if the additional diff is not super complex and is related, we can keep always keep it it in 1 PR |
I've left it separated for now because #32272 is dependent on a flashinfer API change (flashinfer-ai/flashinfer#4124) that has not yet merged, but this PR is ready to merge at anytime. |
|
/tag-and-rerun-ci |
YAMY1234
left a comment
There was a problem hiding this comment.
Two SM120 compatibility notes inline.
Motivation
Enables TRT-LLM's fmha_v2 prefill attention backend for SM90/120. This backend is more performant than the current default (FA3), and also enables skip-softmax feature, which can further boost performance for long-context / applications where attention output is sparse.
Modifications
Baseline enablement of trtllm's fmha_v2 prefill kernel for SM90/120. #32272 is needed for further perf improvement, and #32268 / #32269 are used for the MTP accuracy reporting.
Accuracy Tests
MTP
Add to server launch:
--speculative-algorithm NEXTN --speculative-num-steps 3 \ --speculative-eagle-topk 1 --speculative-num-draft-tokens 4Speed Tests and Profiling
The e2e performance is not improved with just this PR because it requires a large copy operation before the compute kernel to interleave KV. flashinfer-ai/flashinfer#3575 and #32272 address this issue.
Unit Kernel Measurements show ~15% improvement over FA3 over a variety of problem sizes, reaching 20% at small problems.
Skip-Softmax
This feature can provide additional speedup, especially for long-context inference where the attention logits are sparse. We define the threshold factor
\lambda := a / Lwhere a is a hyperparameter, and L is the sequence length. To demonstrate the potential speedup, we keep a = 1000 here for simplicity.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #32205487242
Latest PR Test (Extra): ❌ Run #32205486818