Repository navigation
[ROCm][Model] Enable ROCm AITER unified attention for MiMo-V2.6 - #64064
Merged
tjtanaa merged 2 commits intoOct 29, 2026
Merged
Conversation
vllmellm
requested review from
AndreasKaratzas,
DarkLight1337,
Harry-Chen,
WoosukKwon,
khluu,
mgoin,
tlrmchlsmth,
yewentao256,
ywang96 and
zyongye
as code owners
October 27, 2026 14:50
vllmellm
force-pushed
the
mimo-v2-aiter-unified-attn
branch
from
October 27, 2026 14:57
022600c to
1c72c10
Compare
Member
|
@vllmellm, please run NIAH dataset. |
tjtanaa
reviewed
Oct 28, 2026
tjtanaa
reviewed
Oct 28, 2026
Member
|
/ci run |
|
✅ Triggered Buildkite CI #97895 for commit |
vllmellm
force-pushed
the
mimo-v2-aiter-unified-attn
branch
from
October 28, 2026 07:20
0807008 to
7a9b55a
Compare
vllmellm
requested review from
LucasWilkinson,
alexm-redhat,
njhill,
youkaichao and
zhuohan123
as code owners
October 28, 2026 07:20
Contributor
Author
added the NIAH section. |
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #97904 for commit |
vllmellm
force-pushed
the
mimo-v2-aiter-unified-attn
branch
from
October 28, 2026 10:48
0a90d84 to
9a4ef24
Compare
…sizes Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
vllmellm
force-pushed
the
mimo-v2-aiter-unified-attn
branch
from
October 29, 2026 00:07
9a4ef24 to
7e9ec1c
Compare
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #98144 for commit |
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.
Overview
MiMo-V2.6 has asymmetric K/V head dims (192 / 128), which today pins it to the DiffKV attention backends: any other
--attention-backendis silently replaced by the DiffKV auto-pick, and the native KV-cache write would copy V with K's head width. This PR makes--attention-backend ROCM_AITER_UNIFIED_ATTNusable for the model (opt-in, defaults unchanged) and fixes the write kernel.Claims
--attention-backend ROCM_AITER_UNIFIED_ATTNnow selects unified attention for every MiMo-V2.6 layer instead of being dropped; verified on Flash (TP2, TP4, TP8) and on Pro (TP8, gsm8k n=100 parity).reshape_and_cache_flashwrites V with its own head size and head stride. Symmetric callers run the same code as before: the new checks live in the asymmetric branch, and the existing kernel is byte-identical tomain.--block-size 16on both arms, which tested better than the backend's default for this shape. On Pro at TP8 the same benchmark gives 1.13x prefill and 1.66x lower inter-token latency.Validation
Commands
Bench serve
Mimo-V2.6 Flash at TP4:
On MiMo-V2.6-Pro at TP8:
Acceptance rate:
lm_eval
Needle-In-A-Haystack
Unified attention only;
--max-model-len 270336, thinking off, greedy.Tests
The asymmetric kernel test runs MiMo's geometry (K 192 / V 128, 4 KV heads) at both block sizes the model uses (16 and 64) over a parametrized token count, in both layouts unified attention hands the kernel, for bf16 and fp8 caches and per-tensor and per-head scales. The whole file stays green (694 passed, 602 skipped).
The model test gained two checks: the selected backend's impl has to be unified attention's, not just its enum; and the cache the layer writes has to match a cache built in torch, per slot, with K in the first
head_dimcolumns of a row and V in the remainingv_head_dim. Both fail onmain. The kernel test's buffers carry slack past the cache, so a regressed kernel fails that comparison instead of writing out of bounds.Details
reshape_and_cache_flash_kernelderived one head size, one page stride, one head stride and one element count from key/key_cache and reused all of them for the value side:Every caller until now was symmetric, so this was invisible. Unified attention is the first caller that passes
v_head_size != head_size(MiMo is 192 / 128, packed as one(head_size + head_size_v)content dim per KV head), and for it V was read at K's per-head offset, copied at K's width - 64 elements past the end of each head - and written past the end of the cache on the last slot. The asymmetric case now gets its own kernel that addresses V with the value side's own head stride and length; the existing kernel and its NHD fast path are untouched, so symmetric callers run the same code as before.Model side: the attention backend is chosen per layer, and the gate now consults a backend capability (
supports_head_size_v) rather than listing backend names. DiffKV declares that it can serve any K/V width relation; unified attention declaresv <= k, because it splits the page withsplit(head_size). A backend that cannot serve the shape still gets the previous behaviour: a warning and the DiffKV auto-pick.Known limitations:
mainpins 0.1.26.v_head_dim > head_dimcannot be expressed by its page split); such a request falls back to the DiffKV auto-pick with a warning.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.