Skip to content

[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

Merged
adibarra merged 1 commit into
mainfrom
policy/check13-draft-kv-golden-identity
Nov 24, 2026

Conversation

@seungrokj

Copy link
Copy Markdown
Collaborator

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_e5m2 only if:

  1. It is set through documented flags or config of the pinned image.
  2. For golden/synthetic-acceptance runs, the golden AL identity used records the same draft_kv_cache_dtype in infx/golden_al_distribution/identities.yaml.
  3. It changes only KV storage and the attention-input cast the framework applies automatically for that dtype. It does not cover draft weight, activation or GEMM quantization, or reading the target pool differently. ATOM DSv4.1 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_MOE prohibition, 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

  • Synthetic acceptance. Agentic spec-decode runs use the golden AL curve (checklist L69). spec_identity.py records draft_kv_cache_dtype but 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) and kimi-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.
  • Consistent with MODELS.md L152: "KV cache: FP8 allowed. FP4 only if the native checkpoint ships an FP4 KV cache".
  • Output quality. The draft KV dtype cannot change outputs, because the target verifies every token. It only affects real acceptance, and condition (2) ties that to the measured curve.

Motivating case

Current inconsistency, stated honestly

  • vLLM [AMD] MiniMax-M3.1-Flash MI355X vLLM: PD-disaggregated AgentX over Mooncake / [AMD] MiniMax-M3.1-Flash MI355X vLLM:基于 Mooncake 的 PD 分离 AgentX #5090 (same model and hardware, nvfp4 target, fp8 draft KV) got PASS (comment 7123585382), on the reasoning that fp8 is above an inherited nvfp4 default.
  • That reasoning is probably wrong. The TRITON_ATTN draft backend those recipes pin does not accept nvfp4 (vllm 4fab5a074 triton_attn.py L326-336), so the working default is not nvfp4. I could not check the exact minimax-m31-flash-75bc8cf1 image.
  • Under the current text, the vLLM, SGLang and ATOM fp8-draft-KV lanes are likely all below default. This PR asks core to decide that case on the merits above.
  • b9dfa28 (2026-10-27, direct commit) removed "or KV-cache dtype" from the CONTRIBUTING Forbidden list but left the Allowed bullet and the verifier prompt as they were. @Oseltamivir, was that intended to relax the KV clause? This PR reconciles both files whichever way you answer.

Merged lanes that fail or were not checked against the current text (for context, not endorsement)

PR Framework / HW Target KV → draft KV Verifier Merged by
#4420 vLLM MI355X nvfp4 → fp8 WARN (unverifiable precision, 6363529032) Oseltamivir
#4524 SGLang B300 bf16 → fp8_e4m3 FAIL (6492592606) functionstackx
#4598, #4600 SGLang B200 / GB300 bf16 → fp8_e4m3 no run (claude[bot] flagged) —
#4599 SGLang GB200 bf16 → fp8_e4m3 no run functionstackx
#4671 vLLM MI355X nvfp4 → fp8 PASS (6533164550) Fangzhou-Ai
#4695 SGLang GB200 bf16 → fp8_e4m3 no run edwingao28
#5090 vLLM MI355X PD nvfp4 → fp8 PASS (7123585382) adibarra

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

  • Sub-FP8 draft KV that the framework uses by default, including vLLM's inheritance of the target KV dtype (speculative.py L498-501), stays as it is today. FP4 KV generally remains governed by MODELS.md L152.
  • A follow-up PR can tighten this if core wants.

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.1 draft_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

…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]>
@seungrokj
seungrokj requested a review from a team November 24, 2026 18:37
@adibarra
adibarra merged commit 21ddb35 into main Nov 24, 2026
3 checks passed
@adibarra
adibarra deleted the policy/check13-draft-kv-golden-identity branch November 24, 2026 18:45

@claude claude Bot 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.

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment on lines +676 to +695
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.

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.

🔴 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.

Comment on lines +685 to +688
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).

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.

🔴 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".

Comment on lines +682 to +684
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

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.

🟡 (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.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants