Repository navigation
[Policy] Check 13: allow FP8-class draft KV-cache dtype matching the golden AL identity (motivated by #5157) / [Policy] Check 13:允许与 golden AL identity 一致的 FP8 类 draft KV-cache dtype(由 #5157 引发) - #5208
Conversation
…entity - Allow the draft's own KV-cache storage dtype to be bf16/fp16/fp32/fp8/fp8_e4m3/fp8_e5m2 when set through documented flags, matching the golden AL identity's draft_kv_cache_dtype for synthetic-acceptance runs, and changing storage only. - Other draft KV-cache dtypes (int8, int4, fp8_per_token_head, MXFP8, FP4 class) remain allowed only as the framework default; weight/activation/compute rules are unchanged. - Update CONTRIBUTING "Draft-model precision", the codeowner sign-off verifier prompt (Check 13), and checklist L68 consistently. - 允许 draft 自有 KV cache 的存储 dtype 为 bf16/fp16/fp32/fp8/fp8_e4m3/fp8_e5m2, 前提是通过文档化的 flag 设置、合成接受率运行时与 golden AL identity 的 draft_kv_cache_dtype 一致,且只改变存储。 - 其他 draft KV dtype(int8、int4、fp8_per_token_head、MXFP8、FP4 类)仍只能为框架 默认值;权重/激活/计算规则不变。 - 同步更新 CONTRIBUTING“Draft-model precision”、CODEOWNER 签核验证 prompt(Check 13) 以及 checklist 第 68 行。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
| DRAFT KV-CACHE RULE: besides the framework's default draft KV-cache dtype, the storage | ||
| dtype of the draft's own KV cache may be `bf16`, `fp16`, `fp32`, `fp8`, `fp8_e4m3`, or | ||
| `fp8_e5m2` (or the pinned framework's spelling), even below the framework default or | ||
| different from the target KV-cache dtype, only when (1) it is set through launch flags | ||
| or engine config fields documented by the pinned image, not checkpoint-file edits, | ||
| patches, or undocumented environment variables; (2) for golden/synthetic-acceptance | ||
| runs, the golden AL identity used for that run in | ||
| `inferencex-e2e/infx/golden_al_distribution/identities.yaml` records the same | ||
| `draft_kv_cache_dtype` (a condition checked from the committed file, not an AL-based | ||
| exemption); and (3) it changes only the draft KV storage dtype and the attention-input | ||
| cast the pinned framework applies automatically to read it, not draft weight, | ||
| activation, or GEMM precision or how the draft reads the target's KV pool (ATOM | ||
| DeepSeek-V4.1 `DSparkConfig.draft_kv_dtype=fp8`, MXFP8 with OPUS A8W8, is NOT covered). | ||
| Any other draft KV-cache dtype (`int8`, `int4`, `fp8_per_token_head`, MXFP8, FP4, | ||
| NVFP4, MXFP4, ...) is allowed only as the framework default. For each affected | ||
| configuration, report the effective draft KV-cache dtype, the framework default, and, | ||
| for synthetic-acceptance runs, the golden identity key and its `draft_kv_cache_dtype`. | ||
| PASS this aspect with that note when allowed; FAIL when a non-default draft KV-cache | ||
| dtype is outside the list or does not match the golden identity; WARN when the | ||
| effective value or identity cannot be resolved. |
There was a problem hiding this comment.
🔴 Synthetic-acceptance submissions that raise draft KV precision (say bf16 over an inherited fp8 default) now FAIL Check 13; on the base branch they pass. Line 639 sends every draft KV dtype to this rule only. Under condition (2), any non-default dtype FAILs unless the identity records that exact value, and most identities record value: null, source: default. Fix: limit the identity-match condition to dtypes below the framework default, and say a dtype at or above the default passes as before. Make the same change in CONTRIBUTING.md:77-99.
Why this was flagged
The trigger is an agentic spec-decode run that explicitly sets the draft KV cache to bf16 or fp32 where the framework default is lower. One case is vLLM's draft inheriting an fp8 target KV dtype (the PR cites speculative.py L498-501). Line 639 now judges draft KV dtype "only by the DRAFT KV-CACHE RULE", so the baseline "cheaper than" test at line 638 no longer applies. Lines 693-694 FAIL any non-default dtype that "does not match the golden identity". In identities.yaml, every identity except two records draft_kv_cache_dtype: {value: null, source: default}, so an explicit bf16 never matches. The base branch only FAILed KV overrides "that go below the framework default", so the same recipe passed. CONTRIBUTING.md:77-99 has the same gap.
Verification: The new rule at .github/codeowner-signoff-verify-prompt.md L676-695 says to "FAIL when a non-default draft KV-cache dtype is outside the list or does not match the golden identity". Nothing exempts a dtype at or above the default. On the base, raising draft KV precision passed, so this is a regression in verifier verdicts.
| exemption); and (3) it changes only the draft KV storage dtype and the attention-input | ||
| cast the pinned framework applies automatically to read it, not draft weight, | ||
| activation, or GEMM precision or how the draft reads the target's KV pool (ATOM | ||
| DeepSeek-V4.1 `DSparkConfig.draft_kv_dtype=fp8`, MXFP8 with OPUS A8W8, is NOT covered). |
There was a problem hiding this comment.
🔴 The merged ATOM DeepSeek-V4.1 DSpark lane will now FAIL Check 13 on its next image bump or re-enable. The base branch allowed it as a draft KV that follows an FP8 target. Its recipe sets kv_cache_dtype: fp8, and the draft shares the target's MXFP8 pool. The new rule names that exact setup, DSparkConfig.draft_kv_dtype=fp8, as NOT covered. Line 639 makes this rule the only test for draft KV. Fix: say whether a draft that ATOM ties to the target's KV pool is the framework default. If it is, limit the exclusion to submission-side overrides. Apply the same change at CONTRIBUTING.md:94-95. [also at: .github/codeowner-signoff-verify-prompt.md:684 - Agentic lanes whose draft KV matches an FP8 target KV can now FAIL Check 13. On the base branch they pass under the target-consistent allowance.]
Why this was flagged
The lane on main is dsv41flash-fp4-mi355x-atom-agentic-dspark. Its recipe is inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/dsv41flash/atom/mi355x-fp4-mtp/agentic.yaml. Line 22 sets kv_cache_dtype: fp8 and line 36 sets method: dspark. On the base branch, prompt lines 669-671 allow "an upstream-supported KV-cache dtype applied consistently to target and draft". The new line 639 says draft KV is judged only by the DRAFT KV-CACHE RULE. Lines 685-688 exclude changes to how the draft reads the target's KV pool and name ATOM DeepSeek-V4.1 DSparkConfig.draft_kv_dtype=fp8 (MXFP8 with OPUS A8W8) as NOT covered. The lane also cannot meet condition (2): its identity deepseek-v4.1-flash__dspark__native__probabilistic-block records draft_kv_cache_dtype: {value: null, source: unknown} (identities.yaml:37). So any PR that touches this lane (an image bump, a point change, a re-enable) gets a Check 13 FAIL it would not get on the base branch.
Verification: Trigger: the next image bump or re-enable of dsv41flash-fp4-mi355x-atom-agentic-dspark (configs/amd-master.yaml:1129) that runs Check 13. New line 639 now says "The draft KV-cache dtype is judged only by the DRAFT KV-CACHE RULE below, not by this baseline comparison." Line 688 names "ATOM DeepSeek-V4.1 DSparkConfig.draft_kv_dtype=fp8, MXFP8 with OPUS A8W8, is NOT covered".
| runs, the golden AL identity used for that run in | ||
| `inferencex-e2e/infx/golden_al_distribution/identities.yaml` records the same | ||
| `draft_kv_cache_dtype` (a condition checked from the committed file, not an AL-based |
There was a problem hiding this comment.
🟡 (optional) Verifier runs may wrongly FAIL SGLang fp8_e4m3 lanes, or wrongly PASS fp8_e5m2 lanes, because the identity-match rule never says how dtype names compare. The rule needs identities.yaml to record "the same" draft_kv_cache_dtype. But spec_identity.py:38 rewrites fp8_e4m3 to fp8 and leaves fp8_e5m2 unaliased. Fix: say the comparison uses the normalization in DTYPE_ALIASES (fp8_e4m3→fp8, bfloat16→bf16, auto→default). Also say whether fp8_e5m2 matches an identity recorded as fp8 (e4m3). Make the same change in CONTRIBUTING.md:86-89.
Why this was flagged
Every identity with an explicit draft KV value stores fp8 (identities.yaml:128 and :193). The value is written by _dtype in inferencex-e2e/infx/srt_slurm/spec_identity.py:108-111, which applies DTYPE_ALIASES = {"fp8_e4m3": "fp8", ...} (line 38). SGLang recipes set fp8_e4m3, which the new rule lists as allowed. A literal comparison against the recorded fp8 fails, so the verifier returns FAIL at line 693. A loose comparison has the opposite problem. fp8_e5m2 has fewer mantissa bits than the e4m3 format used to measure the curve, yet the prompt gives nothing to stop it being read as "fp8" and passing. The parenthetical "or the pinned framework's spelling" at line 678 covers only the allowed list, not the identity match. This ambiguity is new with the rule; the base branch has no identity-match condition.
Verification: The new rule in .github/codeowner-signoff-verify-prompt.md (lines 682-684) requires that identities.yaml "records the same draft_kv_cache_dtype". spec_identity.py:38 has DTYPE_ALIASES = {"fp8_e4m3": "fp8", "bfloat16": "bf16", "auto": None}. The minimax SGLang GB300 recipe uses fp8_e4m3. A literal comparison against fp8 gives a wrong FAIL. The prompt never mentions spec_identity.
Disclosure first: this PR is motivated by #5157 (AMD, MiniMax-M3.1-Flash FP4 MI355X ATOM), REJECTED on Check 13 (#5157 (comment)). The author works on #5157. Approval must come from @SemiAnalysisAI/core, the sole CODEOWNER of these files.
Summary
Adds a narrow draft KV-cache dtype rule to Check 13 and CONTRIBUTING "Draft-model precision". Besides the framework default, the storage dtype of a draft's own KV cache may be
bf16/fp16/fp32/fp8/fp8_e4m3/fp8_e5m2only if:draft_kv_cache_dtypeininfx/golden_al_distribution/identities.yaml.DSparkConfig.draft_kv_dtype=fp8(MXFP8 + OPUS A8W8) is explicitly not covered.Any other draft KV dtype (int8, int4, fp8_per_token_head, MXFP8, FP4/NVFP4/MXFP4) is still allowed only as the framework default. Weight, activation and compute rules, the
SGLANG_NVFP4_CKPT_FP8_NEXTN_MOEprohibition, and the patch and pruning rules are unchanged. Eval requirements are unchanged.This is a deliberate, scoped relaxation of the KV clause from #3348. It is not a reinterpretation.
Why this is safe
spec_identity.pyrecordsdraft_kv_cache_dtypebut does not change the curve. A cheaper draft KV is therefore only a loophole when the curve was measured at a higher precision. Condition (2) closes exactly that case. Today only two identities record an explicit fp8 draft KV:minimax-m3.1-flash__dspark__native__probabilistic-block(L183-194, fp8 draft KV, nvfp4 target, collected on vLLM) andkimi-k3.1-pro__dflash__kimi-k3.1-dflash2-preview__default-block(L118-129). Every other curve records the default, so this PR does not change their verdicts.Motivating case
rocm/atom-dev:nightly_202611200431(ATOM 17edc6157) with--kv_cache_dtype nvfp4.--spec-decode-kv-cache-dtype fp8, an upstream flag with choicesbf16/fp8(arg_utils.pyL518-531).atom/config.py~L2063). Per ATOM's own comment, that is a fallback because nvfp4 has no draft layout. It is not an accuracy choice by the model authors.ATOM_USE_UNIFIED_ATTN=1(default0,envs.pyL1012), which the recipe does not set, so c48 changes KV storage only.Current inconsistency, stated honestly
triton_attn.pyL326-336), so the working default is not nvfp4. I could not check the exactminimax-m31-flash-75bc8cf1image.Merged lanes that fail or were not checked against the current text (for context, not endorsement)
The precedents above are context only. This PR does not reopen or retroactively change any merged run or earlier verdict. Lanes whose golden identity does not record fp8 draft KV would still need to come into compliance.
Not changed
speculative.pyL498-501), stays as it is today. FP4 KV generally remains governed by MODELS.md L152.Relation to other PRs
Request to core
@functionstackx @cquil11 @Oseltamivir @nvpohanh: please choose this rule, #4640, or neither. If merged, the #5157 sign-off author will re-run the verifier on the existing sign-off via
workflow_dispatch, at the current #5157 head.Files
CONTRIBUTING.md: baseline sentence (L50-51), new draft KV-cache rule paragraph (after L73), Forbidden bullet (L92), evidence paragraph (L117-119).github/codeowner-signoff-verify-prompt.md: STANDARD (L637-638), new DRAFT KV-CACHE RULE (after L672), FAIL list (L674-676), inspection lead (L704-706), PASS condition (L745)inferencex-e2e/docs/PR_REVIEW_CHECKLIST.md: L68, one clause. Check 5 matches items semantically, so existing sign-offs are not invalidated.中文
先行披露:本 PR 由 #5157(AMD,MiniMax-M3.1-Flash FP4 MI355X ATOM,因 Check 13 被 REJECTED)引发,作者参与 #5157;本文件仅 @SemiAnalysisAI/core 为 CODEOWNER,需其批准。
内容:在框架默认值之外,draft 自有 KV cache 的存储 dtype 可为 bf16/fp16/fp32/fp8/fp8_e4m3/fp8_e5m2,前提是:(1) 通过固定镜像文档化的 flag/config 设置;(2) 合成接受率(agentic)运行时,所用 golden AL identity 记录了相同的
draft_kv_cache_dtype;(3) 只改变 KV 存储及框架为读取该 dtype 自动做的 attention 输入转换,不涉及 draft 权重/激活/GEMM 量化(ATOM DSv4.1draft_kv_dtype=fp8不在此列)。其他 dtype(int8、int4、fp8_per_token_head、MXFP8、FP4 类)仍只能是框架默认值。这是对 #3348 KV 条款有意且有限的放宽。理由:合成接受率不读取 draft KV dtype,条件 (2) 正好堵住此漏洞;目前只有 MiniMax-M3.1-Flash DSpark 与 Kimi-K3.1 DFlash 两条曲线记录 fp8 draft KV;与 MODELS.md L152 一致。#5090 的 PASS 理由很可能有误,三个框架的 fp8 draft KV 在现行文本下都低于默认值,请 core 按本 PR 的理由决定。不追溯已合并运行。
与 #4640/#4705 关系:#4640 完全取消限制,本 PR 为更窄方案,由 core 二选一;与 #4705 不重叠 Check 13,checklist L68 可能有文本冲突,将按先合并者 rebase。
AI disclosure
Drafted with Claude Code (claude-opus-5-5) from repository history, PR and verifier comments, and pinned ATOM / vLLM / SGLang sources. Opened by @seungrokj.
🤖 Generated with Claude Code