Repository navigation
fix(dspark): use aiter's public gfx950_gluon_supported in the Kimi-K3 DSpark GQA draft - #3333
rbrugaro-amd wants to merge 4 commits into
Conversation
…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]>
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (2)
- Drop the
getattrprobe of aiter's private symbols in the function you are touching and call them directly.atom/model_ops/attentions/dspark_block_attn.py:85-92doesgetattr(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). Useua._gfx950_gluon_supported(ua._UAParams(...))and delete themonkeypatch.delattrfallback case intests/test_kimi_k3_dspark_gqa.py:1138-1139. - Open the aiter-side fix for the module boundary and link it here. ATOM builds aiter's private 40-field
_UAParams(16 fieldsNone) 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]>
|
Thanks @valarLip.
|
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (1)
- Delete the now-dead
loggingimport andloggerinatom/model_ops/attentions/dspark_block_attn.py:34,40. The only use was the removed fallback'slogger.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.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
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
left a comment
There was a problem hiding this comment.
✅ 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 loggingandloggerare gone fromatom/model_ops/attentions/dspark_block_attn.py, and the file has nogetattr/hasattrleft. - Fields: still correct on today's aiter. A CPU AST probe against aiter main
9ac5ce9fabshows the kwargs cover every required_UAParamsfield and pass no unknown ones. The probe also shows that the gate's oneNoneread,k_width, sits behindshuffled_kv_cache=False. - Nothing else needed. The
monkeypatchfixture 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.
|
@atom-bot review |
aiter-bot
left a comment
There was a problem hiding this comment.
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]>
|
@valarLip ROCm/aiter#7958 is merged (
End to end at this head on that nightly with aiter #7958 applied ( The PR still shows "Changes requested" from the first review; could you approve if this looks right? |
Problem
aiter made two
_UAParamsfields required:v_cache_dtype(aiter #7421, A8K4V8) andspec_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_supportedwhether the DSpark GQA block read may cast q to the pool dtype. With current aiter it fails: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.pyfail onmainthe 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.DSparkGQABlockAttentioncalls 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_qand_UNFIXED_FIELDSare gone, so a new_UAParamsfield can no longer break the draft.DSparkGQABlockAttentiondropsnum_headsandblock_rows, which only fed the private tuple.This needs an aiter that has #7958 (aiter
mainfrom8b7edc6c54). On an older aiter the draft raisesAttributeErrorat construction instead.Validation
tests/test_kimi_k3_dspark_gqa.pyon one MI355X GPU,rocm/atom-dev:nightly_202611191609with 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. Onmain, 4 of these fail.moonshotai/Kimi-K3+--online_quant_config ptpc_fp8with the RadixArk DSpark GQA draft, TP8/DCP8, fp8 KV, prefix caching, no KV connector, onrocm/atom-dev:nightly_202611191609with 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%). Onmainthe server fails at startup with theTypeErrorabove.🤖 Generated with Claude Code