Repository navigation
[Triton/Gluon] PA decode: config-driven v1/v2 dispatch, gfx950 always v2 wh… - #5859
Conversation
…en split Adds a PA-DECODE config (configs/<arch>/triton/attention/pa_decode/DEFAULT.json) with a per-KV-dtype "dispatch" rule, read through resolve_config_dir / load_config_json by a torch-free _get_dispatch_config() in the kernel module. When a rule exists, v1 is used only for max_num_partitions <= v1_max_partitions; arches/dtypes without a rule (and the per-token-quant path) keep the existing heuristic, so only gfx950 bf16/fp16 changes. gfx950 rule: v1_max_partitions = 1, i.e. v2 whenever the context spans more than one 1024-token partition. The old heuristic chose v1 for num_seqs * num_q_heads > 512 up to 8K context, where v2 is 1.02-4.5x faster on MI355X (5.3x at B=32, ctx 8K, D=64 with CUDA-graph timing). test_pa_decode: 816 passed.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add regression coverage for longer scalar-cache cases and update the dispatch documentation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds config-driven Triton PA decode V1/V2 dispatch, routing gfx950 BF16/FP16 multi-partition workloads to V2.
Changes:
- Adds gfx950 dispatch thresholds.
- Loads per-dtype rules through shared config utilities.
- Applies configured routing while preserving fallback behavior.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx950/triton/attention/pa_decode/DEFAULT.json |
Defines gfx950 dispatch thresholds. |
aiter/ops/triton/attention/pa_decode.py |
Selects V1/V2 using configured rules. |
aiter/ops/triton/_triton_kernels/attention/pa_decode.py |
Loads dispatch configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi @NimitPtl, how is the perf number here compared to the TLX kernel with your changes? |
|
@scxiao erf number in description of PR |


…en split
Adds a PA-DECODE config (configs//triton/attention/pa_decode/DEFAULT.json) with a per-KV-dtype "dispatch" rule, read through resolve_config_dir / load_config_json by a torch-free _get_dispatch_config() in the kernel module. When a rule exists, v1 is used only for max_num_partitions <= v1_max_partitions; arches/dtypes without a rule (and the per-token-quant path) keep the existing heuristic, so only gfx950 bf16/fp16 changes.
gfx950 rule: v1_max_partitions = 1, i.e. v2 whenever the context spans more than one 1024-token partition. The old heuristic chose v1 for num_seqs * num_q_heads > 512 up to 8K context, where v2 is 1.02-4.5x faster on MI355X (5.3x at B=32, ctx 8K, D=64 with CUDA-graph timing).
test_pa_decode: 816 passed.
Motivation
Technical Details
Test Plan
The additional tests are to trigger V2 version which gets triggered only when context is >1024 tokens, which was not tested earlier. New test, basically helps trigger this part. This was getting bypassed earlier in the earlier test coverage.
Test Result
PA decode (Triton) — bf16, query len 1, page size 16 (TB/s of KV cache read)
Submission Checklist