Skip to content

qwen4_exp: ATLAS_QWEN4EXP_SERVING_MODE=strict|spark serving-contract validation (default unset; ported from Enntity) - #229

Merged
AzeezIsh merged 1 commit into
mainfrom
stack/strict-mode
Oct 29, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
stack/strict-mode

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Stack: main ← #198 ← #223 ← #224 ← #226 ← #227 ← this.

Summary

  • Ports Enntity's weight_loader/qwen4_exp/mode.rs (AGPL-3.0, SparkQwen's engine @ d0cead1) with credit. ATLAS_QWEN4EXP_SERVING_MODE=strict|spark validates the serving contract at startup: qwen4_exp at TP2/EP2 without expert-TP; checkpoint LM head; native MTP required with no alternate draft lanes; a pinned set of required flags; and the per-mode drafter flags (DRAFT_HEAD_NVFP4). Startup-parity registered. Unset (default) = no change.
  • Wired into factory/build.rs (MTP load/proposer failures become errors under a mode), preflight/independent.rs, and the startup parity table.
  • Partial port, by design: Enntity's contract also pins MXFP8_DECODE, PREFILL_W8A8 and MTP_BF16_ATTN, which don't exist upstream yet. They're dropped from the contract here and come back with the PRs that add those features. weight_quantizer() returns the standard converter, because the corrected-RNE kernel isn't upstream either (noted in the file header).

Test plan (vs parent #227)

  • qwen4_exp::mode 2/2, qwen_modes preflight 2/2 (reiner)
  • fmt, clippy (no warnings in touched files)
  • one boot with ATLAS_QWEN4EXP_SERVING_MODE=strict: reaches serving, MTP loaded, parity row set; greedy C1 == parent's serial refs (queued after the GLM qualification J33)

Tracking: #220.

Generated with Devin

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Pair check vs parent (binary 6350e73c, two GB10s, rc16 resident profile):

… modes

Explicit strict|spark mode for the Qwen FP4-Local TP2/EP2 pair: a closed
flag contract (REQUIRED_FLAGS + the per-mode draft-head switch), config
topology checks, native-MTP speculation requirement, fast-load + early
topology validation in the serve preflight, startup-parity registration,
and MTP load/proposer failures promoted to errors while a mode is set.
Strict keeps the BF16 draft head (DRAFT_HEAD_NVFP4=0); Spark selects the
NVFP4 draft copy (DRAFT_HEAD_NVFP4=1). Unset retains all current behavior.

Ported from Enntity/atlas weight_loader/qwen4_exp/mode.rs +
qwen_mode_tests.rs (AGPL-3.0-only). Stack adaptations, all noted in the
file header: MXFP8_DECODE, PREFILL_W8A8 and MTP_BF16_ATTN have no
implementation here and are dropped from the contract; the corrected-RNE
quantizer (quantize_bf16_to_nvfp4_weight_rne) is not in this stack, so
weight_quantizer() always names the standard converter — Spark's draft
copy does not carry Enntity's rounding guarantee.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant