Repository navigation
[ROCm][Perf] gfx950: use FlyDSL fp8 MQA logits kernel for the sparse indexer prefill - #59280
amd-sriram wants to merge 3 commits into
Conversation
91aa4c5 to
eaa68b3
Compare
|
✅ @amd-sriram, CI is now available for this PR.
|
|
/ci run |
|
❌ This PR is 15 commits behind upstream |
simondanielsson
left a comment
There was a problem hiding this comment.
Thanks @amd-sriram! Do we also have the TTFT numbers available for the short ctx prefill (1k and 8k), in addition to the e2e throuhgput?
Also optionally, if we'd like to be even more confident we're not regressing here, we could add a benchmark script in /benchmarks/kernels/ and run it for different shapes on gfx950 and compare it to the gluon baseline
| @@ -990,7 +990,7 @@ def rocm_fp8_mqa_logits( | |||
|
|
|||
| k_fp8, scale = kv | |||
|
|
|||
There was a problem hiding this comment.
Suggestion: can you please check if we break test_unpaged_mqa_logits_preserves_intervals_and_scale_layout which assumes the triton kernel will be the one running on gfx950? I.e. run this on an mi350 node
pytest -v -s tests/kernels/attention/test_rocm_triton_attn_dsv4.py
| torch.ones((1,), dtype=torch.int32), | ||
| ) | ||
|
|
||
| assert result is out |
There was a problem hiding this comment.
Nit: Does this line test anything given we return out from all of the mocked implementations?
ed65e6d to
e702868
Compare
9f7b886 to
a288af8
Compare
Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
a288af8 to
1e0befd
Compare
Since the script is just to compare AITER kernels perf, it is ideally having the script live in AITER. We should keep the kernel benchmark scripts necessary mainly for kernels that live in repo. Because the benchmark script should be a developer tool and we should be able to use agent to regen them. However, it is good to disclose the microbenchmark details, and attach the script to the PR description with Detailstag as a record. |
|
@tjtanaa @simondanielsson Thanks for the comments. I am currently working on migrating this to AITER similar to paged mqa logits - ROCm/aiter#6140. I have got some comments from the AITER team. Once I understand how to write the AITER side top level method, I will port this prefill mqa logits to AITER too. Currently, I will mark this as draft and close it when I have the new vllm side PR. |
|
@tjtanaa @simondanielsson I have create an AITER PR to do backend selection for prefill mqa logits - ROCm/aiter#6185. I have drafted a new vLLM PR to call this AITER function. I will open the vLLM PR when the AITER PR gets merged. |
Purpose
Extends #49544 to gfx950: the sparse indexer's prefill MQA logits use the AITER FlyDSL kernel on gfx950 as well as gfx942 whenever AITER is enabled, instead of the Triton/Gluon kernel.
Needs ROCm/aiter#4538, which is in AITER v0.1.23 (the version vLLM main pins).
Test Plan
pytest tests/v1/attention/test_rocm_flydsl_mqa_logits_dispatch.py: gfx942 and gfx950 use FlyDSL when AITER is enabled; other archs use Triton/Gluon; AITER disabled uses the torch fallback. 4/4 pass on MI355X.Test Result
GLM-5.2-MXFP4, TP4, MI355X. Same build for both runs; the only difference is the prefill MQA-logits kernel (Gluon before, FlyDSL with this change).
Accuracy
GPQA is a single run of 198 questions (stderr about 0.02).
ISL 60000 / OSL 600
ISL 8192 / OSL 1024 and ISL 1024 / OSL 1024 (tput/GPU)
Geomean over all 18 points: 1560.4 → 1558.5 tok/s/GPU (−0.1%).
Kernel trace (60k/600 profile, rank 0)
Prefill MQA-logits kernel time: 13,974 ms over 17,738 launches → 9,118 ms over 17,769 launches (−35%, 1.53×). On the same prefill chunk (third 16k chunk of a 60k prompt): 153.4 ms → 98.7 ms.
Gluon (
_gluon_fp8_mqa_logits_kernel, split-KV pair per layer):FlyDSL (
fp8_mqa_logits_H32_D128_mfma32x32x64_bkv64_r2_w2_lds3_swizzled_nocl_flydsl):Both views show the same 6.4 ms window.