Skip to content

fix(dspark): use aiter's public gfx950_gluon_supported in the Kimi-K3 DSpark GQA draft - #3333

Open
rbrugaro-amd wants to merge 4 commits into
ROCm:mainfrom
rbrugaro-amd:rbrugaro/dspark-gqa-uaparams
Open

rbrugaro-amd wants to merge 4 commits into
ROCm:mainfrom
rbrugaro-amd:rbrugaro/dspark-gqa-uaparams

Conversation

@rbrugaro-amd

@rbrugaro-amd rbrugaro-amd commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

aiter made two _UAParams fields required: v_cache_dtype (aiter #7421, A8K4V8) and spec_decode (aiter #7100, SPEC_DECODE mode). gluon_takes_pool_dtype_q (atom/model_ops/attentions/dspark_block_attn.py) built that private 40-field tuple by hand to ask aiter's _gfx950_gluon_supported whether the DSpark GQA block read may cast q to the pool dtype. With current aiter it fails:

TypeError: _UAParams.__new__() missing 2 required positional arguments: 'v_cache_dtype' and 'spec_decode'

So every DSpark GQA draft on an fp8 pool (e.g. the RadixArk Kimi-K3 DSpark draft, #2581) fails at construction and the server doesn't start. 4 tests in tests/test_kimi_k3_dspark_gqa.py fail on main the same way (also noted in #3312). The accuracy CI's Kimi DSpark cases use the Inferact MLA draft, which doesn't go through this read, so they stayed green.

Fix

Ask aiter's public gate instead of building its private tuple. ROCm/aiter#7958 (merged) adds gfx950_gluon_supported(*, q_dtype, kv_cache_dtype, head_size, block_size, ...), which takes only what the gate reads. DSparkGQABlockAttention calls it with q and the K cache in the pool's dtype and the pool's head and entry sizes; the gate's defaults (no softcap, alibi or qq_bias, an unshuffled cache) are the read's.

gluon_takes_pool_dtype_q and _UNFIXED_FIELDS are gone, so a new _UAParams field can no longer break the draft. DSparkGQABlockAttention drops num_heads and block_rows, which only fed the private tuple.

This needs an aiter that has #7958 (aiter main from 8b7edc6c54). On an older aiter the draft raises AttributeError at construction instead.

Validation

  • tests/test_kimi_k3_dspark_gqa.py on one MI355X GPU, rocm/atom-dev:nightly_202611191609 with aiter #7958 applied to its aiter: 44 passed. The gate test checks the exact arguments the read passes; ignoring the gate's answer, or passing a bf16 q, fails it. On main, 4 of these fail.
  • End to end at this head, moonshotai/Kimi-K3 + --online_quant_config ptpc_fp8 with the RadixArk DSpark GQA draft, TP8/DCP8, fp8 KV, prefix caching, no KV connector, on rocm/atom-dev:nightly_202611191609 with aiter #7958 applied: GSM8K 5-shot (full 1319) 96.13% (strict 96.13%), AL 4.10, acceptance 62.03%, matching feat(kimi-k3): DFlash GQA speculative draft model #2581's own validation (0.9591, AL 4.10, 61.98%). On main the server fails at startup with the TypeError above.

🤖 Generated with Claude Code

…n gate probe

aiter made `v_cache_dtype` (#7421) and `spec_decode` (#7100) required
fields of `_UAParams`. `gluon_takes_pool_dtype_q` builds one to ask
`_gfx950_gluon_supported` whether the DSpark GQA block read may cast q to
the pool dtype, so with current aiter every fp8-pool GQA draft (e.g. the
RadixArk Kimi-K3 DSpark draft) raised TypeError at construction.

K and V share the one draft pool's dtype, and the read is all-decode
(max_seqlen_q == 1), so spec_decode is False, as aiter derives it
(equal_seqlen_q and not all_decode).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every eligible PR before approval:

  • ✅ Pre Checkin: Black, Ruff, catalog schema validation, non-GPU unit tests

Heavy model tests:

  • ✅ Run after the PR is approved and Pre Checkin passes
  • ✅ Run immediately when an approval review is submitted
  • ✅ Can be requested before approval with labels
Label Tests
ci:full Run all heavy PR model tests: native ATOM, vLLM, and SGLang
ci:atom Run native ATOM model accuracy tests
ci:vllm Run ATOM vLLM OOT model accuracy tests
ci:sglang Run ATOM SGLang model accuracy tests

Heavy jobs are skipped when the PR is not approved and no matching ci:* label is present.
Add labels via the sidebar or gh pr edit 3333 --add-label <label>

@valar-cop valar-cop left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

ci green.

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ Action required before merge (2)

  1. Drop the getattr probe of aiter's private symbols in the function you are touching and call them directly. atom/model_ops/attentions/dspark_block_attn.py:85-92 does getattr(ua, "_gfx950_gluon_supported", None) / getattr(ua, "_UAParams", None) and silently falls back to bf16 q (a perf loss, only a log warning) if aiter renames them. ATOM does not probe aiter APIs; pin the aiter version instead (#3162 is what such a probe cost on gfx1250). Use ua._gfx950_gluon_supported(ua._UAParams(...)) and delete the monkeypatch.delattr fallback case in tests/test_kimi_k3_dspark_gqa.py:1138-1139.
  2. Open the aiter-side fix for the module boundary and link it here. ATOM builds aiter's private 40-field _UAParams (16 fields None) only to ask _gfx950_gluon_supported, which reads 10 of them and neither of the two you add. Every new required field breaks Kimi-K3 DSpark GQA startup (aiter #7100 on 11-09 and #7421 on 11-10, both now on aiter main). Ask aiter for a public predicate taking just those inputs (dtypes, head sizes, block size, softcap/alibi/qq_bias, shuffled layout), then switch this function to it and delete _UNFIXED_FIELDS. This 2-line stopgap can land first once item 1 is done.

Checked: both added fields are required on aiter main (0f6cb2f), the values are right (spec_decode is equal_seqlen_q and not all_decode, so False with all_decode=True; one pool, so V dtype = K dtype), and a CPU AST probe confirms the kwargs now cover every required field (main misses exactly these two). Nits: pin the two new fields in test_fp8_q_cast_asks_aiters_gluon_gate_with_the_reads_arguments (assert p.v_cache_dtype == fp8 and p.spec_decode is False next to line 1123), since its docstring says it checks every field the deployment fixes; the docstring "a renamed or added field raises" (line 83) is only true for required fields; a new defaulted field passes silently. Non-GPU CI skips this file's gate test (gpu_stack_import), so "CI green" does not exercise the change.


Reviewed at 2245310380.

ATOM does not probe aiter APIs: a renamed `_gfx950_gluon_supported` /
`_UAParams` used to fall back to a bf16 q with only a warning. Call them
directly, so a rename raises. The gate test pins the two new fields and drops
the missing-gate case; the docstring says a new defaulted field passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rbrugaro-amd

Copy link
Copy Markdown
Contributor Author

Thanks @valarLip.

  1. Done in 1d8a390c6: gluon_takes_pool_dtype_q calls ua._gfx950_gluon_supported(ua._UAParams(...)) directly, so a renamed symbol or a new required field raises instead of falling back to a bf16 q. The monkeypatch.delattr case is gone, the gate test now pins p.v_cache_dtype == fp8 and p.spec_decode is False, and the docstring says a new defaulted field keeps its default rather than raising. tests/test_kimi_k3_dspark_gqa.py on MI355X with aiter 0.1.30.dev140: 44 passed; dropping spec_decode fails the gate test.
  2. aiter side: [Triton/Gluon] unified_attention: public gfx950 Gluon gate predicate aiter#7958 adds a public gfx950_gluon_supported(*, q_dtype, kv_cache_dtype, head_size, block_size, head_size_v=None, shuffled_kv_cache=False, k_width=None, softcap=0.0, use_alibi_slopes=False, use_qq_bias=False) that takes only what the gate reads; _gfx950_gluon_supported(params) now delegates to it, so aiter keeps one definition. Once it ships, I'll switch this function to it and delete _UNFIXED_FIELDS, as a follow-up to this stopgap.

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ Action required before merge (1)

  1. Delete the now-dead logging import and logger in atom/model_ops/attentions/dspark_block_attn.py:34,40. The only use was the removed fallback's logger.warning; ruff does not flag it because the name is assigned. Non-blocking, can go in with this push or the aiter#7958 follow-up.

Checked: item 1 is fixed. gluon_takes_pool_dtype_q calls ua._gfx950_gluon_supported(ua._UAParams(...)) directly (dspark_block_attn.py:85,109), no getattr/hasattr is left in the file, and the monkeypatch.delattr case is gone from the test. Item 2 is acknowledged as a follow-up: ROCm/aiter#7958 (open) adds a public gfx950_gluon_supported(*, q_dtype, kv_cache_dtype, head_size, block_size, ...); please switch to it and delete _UNFIXED_FIELDS once it is on aiter main. A CPU AST probe against aiter main edf58c67a confirms the kwargs cover every required _UAParams field and pass none unknown. The previous nits are also done: the gate test now pins v_cache_dtype == fp8 and spec_decode is False, and the docstring says a new defaulted field keeps its default. CI: Pre Checkin, smoke and gates pass. Heavy accuracy is skipped until approval. The gate test is skipped off-GPU (gpu_stack_import), so the author's MI355X run (44 passed, Kimi-K3 GSM8K 95.91%) is the evidence for this path. Main's K3 DSpark GQA does not start without this PR, so please merge it soon.


Re-reviewed at 1d8a390. Already fixed: getattr probe of aiter private symbols removed (item 1); aiter public gate predicate tracked in ROCm/aiter#7958 (item 2, follow-up); test pins both new fields; docstring corrected.

@rbrugaro-amd

Copy link
Copy Markdown
Contributor Author

Done in 57a26a4: the logging import and logger are gone. tests/test_kimi_k3_dspark_gqa.py on MI355X: 44 passed. I'll switch to gfx950_gluon_supported and drop _UNFIXED_FIELDS once ROCm/aiter#7958 is on aiter main.

@valarLip valarLip added ci:atom LGTM waiting pass for CI labels Nov 14, 2026

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ LGTM

The code is done. Nothing is left to change in this PR. Before merge, heavy accuracy CI still has to run: it is skipped until approval or a ci:* label. The last heavy run, at 2245310, passed (ATOM, vLLM, SGLang).

Checked at head:

  • Last round's item (dead logger): fixed. import logging and logger are gone from atom/model_ops/attentions/dspark_block_attn.py, and the file has no getattr/hasattr left.
  • Fields: still correct on today's aiter. A CPU AST probe against aiter main 9ac5ce9fab shows the kwargs cover every required _UAParams field and pass no unknown ones. The probe also shows that the gate's one None read, k_width, sits behind shuffled_kv_cache=False.
  • Nothing else needed. The monkeypatch fixture is still used. The PR merges cleanly onto current main.

Follow-up, already committed by the author: once ROCm/aiter#7958 (still open) is on aiter main, switch to its public gfx950_gluon_supported and delete _UNFIXED_FIELDS. The gate test is skipped off-GPU (gpu_stack_import), so the MI355X run (44 passed, Kimi-K3 GSM8K 95.91%) is the evidence for this path. Main's K3 DSpark GQA draft fails at startup without this fix, so please merge once heavy CI is green.


Re-reviewed at 57a26a4. Already fixed: getattr probe of aiter private symbols removed; aiter public gate predicate tracked in ROCm/aiter#7958 (follow-up); test pins v_cache_dtype/spec_decode; docstring corrected; dead logging import/logger removed.

@zufayu

zufayu commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

@atom-bot review

@aiter-bot aiter-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ATOM PR #3333 — fix(dspark): pass aiter's new _UAParams fields in the Kimi-K3 DSpark GQA draft

Passes the two fields aiter newly made required on _UAParams (v_cache_dtype, spec_decode) in the Kimi-K3 DSpark GQA draft's build-time probe of aiter's gfx950 Gluon gate, and drops the old getattr fallback so a missing or renamed aiter symbol now raises at draft build instead of silently keeping q in bf16 over an fp8 pool.

Review: ✅ LGTM

Validation (deterministic): NOT RUN -- auto-validation disabled (REVIEW_AUTO_VALIDATE=0) and this box has no aiter/GPU stack to run tests/test_kimi_k3_dspark_gqa.py (its gate test skips without aiter); the on-record runtime evidence is the author's MI355X run (44 passed, Kimi-K3 GSM8K 95.91%) and heavy CI green at head

_Independent refutation: 0 judged, 0 killed, 0 defended — same-family (claude reviewed its own output). Step 7.6 above

…ad's q cast

ROCm/aiter#7958 exposes the gfx950 Gluon gate as a public predicate that
takes only what the gate reads. Use it instead of building aiter's private
_UAParams by hand: gluon_takes_pool_dtype_q and _UNFIXED_FIELDS are gone, and
a new _UAParams field can no longer break the Kimi-K3 DSpark GQA draft.
DSparkGQABlockAttention drops num_heads and block_rows, which only fed the
private tuple.

Co-Authored-By: Claude Code <[email protected]>
@rbrugaro-amd rbrugaro-amd changed the title fix(dspark): pass aiter's new _UAParams fields in the Kimi-K3 DSpark GQA draft fix(dspark): use aiter's public gfx950_gluon_supported in the Kimi-K3 DSpark GQA draft Nov 20, 2026
@rbrugaro-amd

Copy link
Copy Markdown
Contributor Author

@valarLip ROCm/aiter#7958 is merged (8b7edc6c54), so I made the switch here instead of in a follow-up, in 804423ff6:

  • DSparkGQABlockAttention asks ua.gfx950_gluon_supported(q_dtype=, kv_cache_dtype=, head_size=, block_size=) for the q cast. gluon_takes_pool_dtype_q and _UNFIXED_FIELDS are deleted, with the get_num_sms import they needed.
  • The constructor drops num_heads and block_rows, which only fed _UAParams; kimi_k3_dspark_gqa.py and the tests follow.
  • The gate test now checks the exact keyword arguments the read passes.

tests/test_kimi_k3_dspark_gqa.py on one MI355X GPU, rocm/atom-dev:nightly_202611191609 with aiter #7958 applied: 44 passed; ignoring the gate's answer or passing a bf16 q fails the gate test. This head needs an aiter with #7958: on that nightly's own aiter (956fd46d8) the draft raises AttributeError: ... has no attribute 'gfx950_gluon_supported'. CI installs the latest aiter main wheel, so it has it.

End to end at this head on that nightly with aiter #7958 applied (moonshotai/Kimi-K3 + online ptpc_fp8, RadixArk draft, TP8/DCP8, fp8 KV): GSM8K 5-shot full 96.13%, AL 4.10, acceptance 62.03%.

The PR still shows "Changes requested" from the first review; could you approve if this looks right?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:atom LGTM waiting pass for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants