[CUDA] Enable XQA by default for FP16/BF16 GQA#29046
Open
namgyu-youn wants to merge 3 commits into
Open
Conversation
Signed-off-by: namgyu-youn <namgyu.dev@gmail.com>
Author
|
@microsoft-github-policy-service agree |
Author
|
update via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enable XQA by default for non-quantized FP16/BF16 GQA. XQA is a TensorRT-LLM-derived fused decode kernel (
seq_len=1) that also fuses RoPE + KV-append into a single pass. Requires SM80+, shared KV buffer, no softcap.Also add
group_size=5XQA support (e.g. Qwen3-14B: 40 Q-heads / 8 KV-heads) for the Qwen series.Affected models
Performance Result
repro:
Benchmark: Qwen3-14B (40Q/8KV heads, head_dim=128, fp16, batch=1, SM80, CUDA12.8)
Speedup grows with context length (1.30× → 1.57×). No regression in the prompt/prefill path.
Testing
pytest onnxruntime/test/python/transformers/test_gqa.py -vORT_ENABLE_XQA=0 pytest onnxruntime/test/python/transformers/test_gqa.py -v(opt-out smoke test)