Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ab4265b to
9cb100b
Compare
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment Once the PR is approved or has the If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban. 🚀 |
|
This pull request has merge conflicts that must be resolved before it can be |
9cb100b to
cd21adb
Compare
8ee62a3 to
4bf2c04
Compare
AndreasKaratzas
left a comment
There was a problem hiding this comment.
I dont know if all of these changes are needed, but the tests look like they need to be revised.
|
This pull request has merge conflicts that must be resolved before it can be |
02ce906 to
1f519ac
Compare
1f519ac to
9b4f36e
Compare
… AITER Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Ethan Ky <ethan.ky@amd.com>
9b4f36e to
7726be2
Compare
…et_cos_sin_split Signed-off-by: Ethan Ky <ethan.ky@amd.com>
Purpose
On the ROCm/AITER MLA path of DeepSeek-R1, every decode step's per-layer q/k preparation runs:
concat_and_cache_mla_rope_fused(rope on q_pe/k_pe + the fp8 KV-cache write of[kv_c | k_pe]— already fused by thefuse_rope_kvcache_cat_mlacompile pass).[ql_nope | rope(q_pe)], launched via themla_decode_concat_quant_fp8op.This PR replaces 1+2 for decode-only with a single AITER HIP kernel
(
fused_qk_rope_concat_and_cache_mla): rope (fp32), the fp8 KV-cache write, and the assembledquantized decode query in one launch, so:
concat_and_cache_mla_rope_fusedkernel the baseline pass usesHow it works:
MLAAttention(attach_rotary_emb, eligibilitydecided once at load) and passes
positionsthrough; the graph then contains no rope andno
unified_mla_kv_cache_updatenode, so the existingMLARoPEKVCacheCatFusionPasshasnothing to match.
forward_implbranches per batch onattn_metadata: decode-only steps make the singleAITER launch; steps with any prefill tokens call the same
concat_and_cache_mla_rope_fusedkernel the baseline pass produces (eagerly), then proceeds same as beforeBefore fusing (4µs 759ns + 4µs 479ns = 9µs 238ns per layer, decode):
After fusing (4µs 45ns, 2.08x faster):
Test Plan
greedy client (
vllm bench serve --temperature 0.0 --top-p 1.0), fp8 KV cache,VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1 VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4.Test Result
Note
Tests executed on an 8×MI355X node against the
vllm/vllm-openai-rocm:nightlyimage(stock torch 2.12 / amd-aiter 0.1.19 / triton 3.7.1), as an A/B against vLLM
main(1f1f628) on the same machine and container.
Benchmark
Per-kernel (decode, per layer, from the profiled traces of the same two runs):
concat_and_cache_mla_rope_fused4.759 µs + Triton q concat/quant 4.479 µs →fuse_qk_rope_concat_and_cache_mla_per_head4.45 µs (−4.788 µs/layer, −0.29 ms per decodestep across 61 layers).
Accuracy Test
Full GSM8K evaluation with the env enabled (1,319 examples):
Baseline
mainon the same setup: 0.9522 / 0.9507.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.