Skip to content

[Triton/Gluon] [GFX12] Add SPEC_DECODE mode to UA with tunned Qwen35 config - #7100

Merged
vgokhale merged 11 commits into
mainfrom
shaoclee/bench_ua_perm
Nov 9, 2026
Merged

vgokhale merged 11 commits into
mainfrom
shaoclee/bench_ua_perm

Conversation

@k50112113

Copy link
Copy Markdown
Contributor

No description provided.

@k50112113
k50112113 requested a review from a team October 28, 2026 15:57
@k50112113
k50112113 marked this pull request as draft October 28, 2026 15:57
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7100 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new flag breaks existing positional backend calls, the speculative-decode 3D path is unreachable through dispatch, and the new query-indexing and padded-batch paths lack regression coverage.

3 open issues
What changed in this PR

Adds an equal-query-length mode to unified attention for speculative decoding on gfx1250, with tuned settings for Qwen35 workloads.

Changes:

  • Adds equal_seqlen_q and fixed-length query indexing to the gfx1250 Gluon kernels.
  • Adds BF16 tuning entries and query-count selection for 3D attention configs.
  • Extends the benchmark with an equal-query-length flag and revises KV-cache block allocation.
File Description
op_tests/​op_benchmarks/​triton/​bench_unified_attention.py Adds the benchmark flag and revises cache-block setup.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​attention/​unified_attention/​DEFAULT.json Adds query-dependent selection and BF16 tuning entries.
aiter/​ops/​triton/​attention/​unified_attention.py Adds the public flag and speculative-decode launch parameters.
aiter/​ops/​triton/​_gluon_kernels/​gfx1250/​attention/​unified_attention_3d.py Adds fixed-length query-block mapping and tracing keys.
aiter/​ops/​triton/​_gluon_kernels/​gfx1250/​attention/​unified_attention_2d.py Adds fixed-length query-block mapping and an empty-KV guard.

Review effort: Balanced

vgokhale pushed a commit that referenced this pull request Oct 28, 2026
…config (#7100)

#7100 (head 4833e50, open against main) applied to the Qwen
branch: a SPEC_DECODE mode for the 2d and 3d unified-attention kernels,
taken when the caller passes equal_seqlen_q (every sequence holds
max_seqlen_q queries), which launches the exact query-block grid and drops
the cu_seqlens_q search; tuned gfx1250 configs for head size >= 256 with
up to 4 queries per sequence; and the benchmark's block table as a
permutation.
@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 93d568469ca8 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/op_benchmarks/triton/bench_unified_attention.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/attention/test_unified_attention.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@k50112113
k50112113 marked this pull request as ready for review October 29, 2026 20:53
vgokhale added a commit that referenced this pull request Oct 29, 2026
… and attn_3d routing

Takes the current head of #7100 (3e1ced4) on top of the version already
on this branch (864205b): the G axis (num_queries_per_kv) in the config lookup, with
the P axis it sits beside on main; the TP4 (G = 4) bf16 entries for d 256 with 16- and
64-token KV blocks; and attn_3d entries steering use_2d_kernel through
MAX_QUERY_ROWS_PER_CU (the short-query rows cap) and PREFILL_MAX_2D_PRGMS /
PREFILL_MIN_KV / PREFILL_MIN_KV_PER_PRGM (the 3D split for prefill over a long cached
prefix). The launchers drop those keys before launching. #7100's kernel files are not
taken: their differences from this branch are main's, which this Triton cannot build.

A short-query batch whose entry has no tuned rows cap (DEP4's 16 q / 2 kv heads) keeps
this branch's exact-grid gate and split (c3bb8eb): #7100 would fall back to 8 rows
per CU there, which sends a 96-sequence MTP-3 verify to the 2D kernel at about 2x the
3D kernel's time.

Qwen3.5-35B-A3B DEP4 c2048 MTP-3, ATOM_USE_UNIFIED_ATTN=1 with 64-token blocks (with the
2D kernel's runtime block-table stride, next commits): decode attention 518 -> 336 us
a call (6.4 -> 4.4 ms a step), prefill attention 57 ms a step against 63 ms for the
FlyDSL FMHA plus its KV gather.

Co-authored-by: ShaoChunLee <[email protected]>
@zufayu
zufayu requested review from a team and Dewei-Wang-sh October 30, 2026 01:28
@azaidy
azaidy requested a review from vgokhale November 4, 2026 09:10
@vgokhale
vgokhale merged commit b263a89 into main Nov 9, 2026
@vgokhale
vgokhale deleted the shaoclee/bench_ua_perm branch November 9, 2026 15:45
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
akao-amd added a commit to akao-amd/aiter that referenced this pull request Nov 10, 2026
…gluon-ua2d-mask-stale-v

Keep the poisoned-V-tail test beside the spec-decode tests from ROCm#7100.

Co-authored-by: Cursor <[email protected]>
vgokhale pushed a commit that referenced this pull request Nov 20, 2026
…7958)

* [Triton/Gluon] unified_attention: expose the gfx950 Gluon gate as gfx950_gluon_supported

`_gfx950_gluon_supported` takes the private `_UAParams`, so a caller that
decides something from the gate up front (ATOM's Kimi-K3 DSpark draft picks
its q dtype by it) has to build all of `_UAParams` by hand, and every new
required field breaks it (#7100, #7421). `gfx950_gluon_supported` takes only
what the gate reads; `_gfx950_gluon_supported` delegates to it, so the gate
keeps one definition and unified_attention's behaviour is unchanged.

* [Triton/Gluon] unified_attention: shorten the gfx950_gluon_supported docstring

A one-line summary, one entry per argument and the return value, as the
Triton ops guidelines ask for a public function.

* [Triton/Gluon] unified_attention: drop the gfx950_gluon_supported tests

Review: the private gate delegates to the public function, so a test that
compares the two cannot fail, and the rest tests plumbing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants