Repository navigation
attention: Triton paged_attention_decode kernel for Muse Spark - #81
Merged
Merged
Conversation
…contracts [email protected] is one-token paged decode on vLLM's kv_split_pages cache, timed against aiter's paged_attention_v1; [email protected] is the multi-token decode vLLM's ROCM_AITER_FA backend runs, timed against aiter's Triton unified_attention. Both baselines call aiter as that backend does. An attr value may now be a tuple of ints, so window_size is the attr (-1, -1) or (2047, 0) as vLLM passes it; softcap is a scalar and the descales optional inputs that must be absent. Adds the KvSplitPages and StridedRows layouts and Muse (16/2/64/16) definition schemas for both.
…one-token decode One program per (request, KV segment) runs all 16 query heads as one MFMA tile over both kv heads' K/V tiles (a block's two heads are 8 KB contiguous in vLLM's kv_split_pages cache), the cross-head logits masked. A request is cut into segments of a per-batch tile count, one of at most 2560 tokens (vLLM's 2048-token sliding window, a short context) into up to 32 segments; the launch depends only on batch and table width. fp32 partials merge in a second kernel; no program waits for another. Replaces the kernel-less definition schema and serves batch 1..64 except 25, 41, 49 and 59 (0.98-1.03x), which stay on aiter.
…t clears AITER Non-spec Muse decode runs up to --max-num-seqs 128. Batch 65..128 is memory bound against AITER's paged_attention_v1 (0.87-1.10x over three runs with the batch 56 plan; four other plans did worse), so add only the 18 batches at 1.04x or more in all three runs. Batch 54 leaves: 1.028-1.035x over four runs.
fanxingran
requested review from
irvineoy,
jiejingzhangamd,
xiaobochen-amd and
zhenhuang12
as code owners
November 6, 2026 04:53
…-attention-paged-triton # Conflicts: # aklr/ops/README.md # tests/ops/names.txt
…on 3.8 kernel.requires (#168) for the kernel this PR adds; its uuid changes with it.
fanxingran
changed the base branch from
fanxingran/muse-spark-attention-contracts
to
main
November 16, 2026 06:37
fanxingran
temporarily deployed
to
gpu-trusted
November 16, 2026 07:20 — with
GitHub Actions
Inactive
…-attention-paged-triton
fanxingran
temporarily deployed
to
gpu-trusted
November 17, 2026 09:15 — with
GitHub Actions
Inactive
kyle-256
approved these changes
Nov 18, 2026
This branch was previously deployed
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.
Why
Muse Spark's one-token decode on vLLM's ROCM_AITER_FA backend calls aiter's
paged_attention_v1; thisadds a Triton kernel for its
[email protected]shape (16/2/64/16, NHD kv_split_pages): oneprogram per (request, KV segment) runs all 16 query heads as one MFMA tile over both kv heads, and a
second kernel merges the segments.
The contract and its definition schema reached main in #114 (#79, this PR's former base, is closed);
this PR now targets main and adds only the kernel schema.
Scope
paged_attention_decode_kv_split_pages_n_heads16_n_kv_heads2_head_dim64_block_size16(Triton,requires: {"triton": ">=3.8"}): batch 1..64 except 25, 41, 49, 54 and 59, and 65..76, 78, 80, 81,83, 89, 98 (77 batches; vLLM's Muse recipe runs
--max-num-seqs 128, the others stay on AITER).Main's definition schema for the shape (
6c3a63a04ab9207f.json, no sources) stays: it still liststhe batches this kernel does not serve.
vllm/vllm-openai-rocm:nightly) Muse with DSpark decodes throughunified_attentiononly (attention: Triton unified_attention decode kernel for Muse Spark #80); this kernel serves deployments without speculative decoding.sliding_window > 0, any table width), as vLLM main'suse_swa_pagedcalls it (table trimmed to the window's 129 blocks,sliding_window=2048).Tradeoffs
1.023 – 1.049x) are kept, measured but not served unless the publish-measurement bot's run on main
reaches 1.05. These batches are memory bound (below), and which of them clear a given bar follows
each one's drawn contexts more than its launch shape: in earlier runs batch 66 ran 1.04 – 1.06x and
42 ran 1.04 – 1.05x.
the trimmed-window and short-context calls at batch >= 16 ran 0.55 – 0.99x of AITER (too few
programs); with it they run 1.12 – 1.59x, and the bench's workloads lose about 0.5%.
Triton streaming read reaches 5.0 – 5.2 TB/s here, so batch 25..64 has little headroom.
(32, 32, 1), (32, 16, 2), (32, 32, 2), (64, 8, 2)) did worse (geomean 0.966 – 1.002); only the 18
batches at 1.04x or more in three earlier runs are listed.
Verification
Environment: head
3500481(main78496c0merged in), MI355X x1,lmsysorg/sglang:v0.5.22-rocm10-mi35x(sha256:1438dd8b), torch 2.11.0+rocm10.0.0, FlyDSL 0.3.2,Triton 3.8.0, AITER
dbd8bf5bd(AKLR_BASELINE_AITER)Gate overrides: none
Kernels
paged_attention_v1Stress (every workload of batch 1..64 on streams limited to 16 and 64 CUs and beside a second call,
the same kernel source): bitwise the same output, PASS.
Sliding-window and short-context decode (local, the same kernel source; graph replay, against aiter on
the same call; max abs error vs float64 at most aiter's):
sliding_window=2048, contexts 1..32768sliding_window=2048, contexts 2048..32768sliding_window=1000, contexts 100..2048sliding_window=5, contexts 1..32768Validation log
The one test failure (
qwen3_next_gdn_prefill_group_fp8_quant'sdelta_statebound) fails thesame on main
78496c0and touches nothing here.Not run
vLLM plugin route calls
aklr.ops.paged_attention_decodeyet.sliding_window=0; the sliding-window rows above are a local check.Risk
Affects:
aklr.ops.paged_attention_decodecalls at Muse's shape (16/2/64/16) on MI355X.If wrong: wrong attention output for Muse one-token decode.
Undo:
[email protected]runs AITER; otherwisegit revert. The schema has nospeedupuntil the publish-measurement bot measures it on main.