Repository navigation
[ROCm] Build per-sequence indexer decode lengths once per step - #29
Open
amd-sriram wants to merge 1 commit into
Open
amd-sriram wants to merge 1 commit into
amd-sriram wants to merge 1 commit into
Conversation
The builder stores the last column of the (B, next_n) seq_lens table; the AITER paged MQA-logits calls read it, so no per-layer copy. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks 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 |
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.
Purpose
Alternative to vllm-project#59420 for review comparison. On ROCm the sparse indexer passes the
(B, next_n)per-rowseq_lenstable to the AITER paged MQA-logits kernels, which read one length per sequence, so with native MTP decode they get the wrong lengths. vllm-project#59420 fixes this by copying the table's last column insiderocm_fp8_paged_mqa_logits, which runs once per indexer call (every layer).Here the indexer metadata builder makes that copy once per step instead, into a persistent buffer, and the AITER calls read it. No AITER change and no per-layer copy.
Details
DeepSeekV32IndexerDecodeMetadata.per_req_seq_lens:(B,)last column ofseq_lens. Set on ROCm only, and only whenseq_lensis(B, n > 1)(native MTP); otherwiseNone.seq_lens. Persistent buffer, so the address is stable for CUDA graphs.rocm_fp8_paged_mqa_logits(..., per_req_context_lens=None): used for the AITER Gluon and stage1 calls when given. The C4A Triton and torch paths keep reading the 2D table, which they handle per row.rocm_aiter_mla_sparse.pyandglm5next/amd/sparse_indexer.py.Test Plan
pytest tests/v1/attention/test_rocm_indexer_per_req_seq_lens.py(new): the AITER Gluon (gfx950) and stage1 calls getper_req_context_lenswhen given andseq_lensotherwise.rocm_fp8_paged_mqa_logitsagainstfp8_paged_mqa_logits_torch, B=16,next_n=3, varied lengths, the builder's(B, next_n)table and its last column.Test Result
-infmask. Withper_req_context_lens: 0/48.build()on ROCm with MTP), and e2e perf.