Skip to content

[Bug] Attention with sink shouldn't be dispatched to assembly impl of flash_attn_varlen_func - #6906

Merged
zufayu merged 1 commit into
ROCm:mainfrom
qli88:qiang_ticket_400
Oct 27, 2026
Merged

zufayu merged 1 commit into
ROCm:mainfrom
qli88:qiang_ticket_400

Conversation

@qli88

@qli88 qli88 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

This impl doesn't support sink so it should explicitly reject the dispatch. Otherwise it will make models with sinks, like granite, fail on gfx942/950.

@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 6906 --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.

@qli88
qli88 marked this pull request as ready for review October 26, 2026 19:10
@qli88
qli88 requested review from a team and a balanced review from Copilot October 26, 2026 19:10

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

Regression tests are needed to verify that both dispatchers bypass assembly and preserve sink arguments in the fallback.

1 open issue
What changed in this PR

This PR prevents sink-enabled attention calls from reaching unsupported v3 assembly kernels on gfx942/gfx950, covering both fixed-length and variable-length attention.

Changes:

  • Exclude calls with sink_ptr or nonzero sink_size from v3 assembly dispatch.
  • Document why sliding-window checks alone do not exclude sink requests.
File Description
aiter/​ops/​mha.py Adds sink eligibility guards to both v3 forward dispatchers.

Review effort: Balanced

Comment thread aiter/ops/mha.py Resolved
Copilot AI balanced review requested due to automatic review settings October 26, 2026 19:57

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.

🔵 Needs a closer look

The guards appear correct, but execution of the regression tests on gfx942 and gfx950 remains unverified.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@zufayu
zufayu merged commit 9b1dfee into ROCm:main Oct 27, 2026
71 checks passed
jatseng-ai added a commit to jatseng-ai/aiter that referenced this pull request Nov 2, 2026
The v3 ASM gate itself landed in ROCm#6906. This covers hdim 192, North Mini
and Command A Plus GQA ratios, and a numeric check that the sink moves
the output.

Co-authored-by: Cursor <[email protected]>
AndreasKaratzas added a commit to engint-cerebras/vllm that referenced this pull request Nov 4, 2026
The test builds an NHD cache, so pin _SHUFFLE_KV_CACHE_ENABLED like the
shared-KV test does; it failed with VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT=1.
Also note the third request's empty chunk and that the hd128 v3 sink drop
is fixed in aiter 0.1.28 (ROCm/aiter#6906).

Co-authored-by: Claude <[email protected]>
Signed-off-by: Andreas Karatzas <[email protected]>
shay-li77 pushed a commit that referenced this pull request Dec 3, 2026
…el (#6893)

The v3 ASM gate itself landed in #6906. This covers hdim 192, North Mini
and Command A Plus GQA ratios, and a numeric check that the sink moves
the output.

Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants