Repository navigation
qwen4_exp: no final RMSNorm after the hyper-connection mixer (split from #91) - #111
Conversation
qwen4_exp's last layer runs the model-level hyper-connection mixer, whose hc_norm is the model's final normalization; the reference feeds the mixer output straight to lm_head. Atlas still ran the model-level final RMSNorm before every LM head, with the ones-filled placeholder weight through the (1 + w) kernel, so each position's logits were rescaled by 2 / rms(x): the argmax survived (greedy output looked right) but every probability was wrong. Teacher-forced wikitext perplexity on the RadixArk NVFP4 pack was 4.28 in Atlas against 2.29 in vLLM on the same weights. final_norm_rows replaces the 18 final-norm call sites (prefill last-token, prompt logprobs, decode, batched decode, verify paths): a stream-ordered copy when final_norm_identity is set (qwen4_exp only), the unchanged RMSNorm otherwise. The loader comment that called the placeholder unreachable is corrected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…f truth Review follow-ups on the final-norm fix: - The predicate moves to ModelConfig::final_norm_is_identity, next to the other per-model switches (skip_lm_head_quantization), instead of a string match inside the model module. - The identity is only correct when the last layer runs the hyper-connection mixer that collapses the streams into hidden_size rows; only attention layers call hc_head_site. check_final_norm_identity now refuses, at model build, a config without hyper-connections or whose last layer is not full attention, naming the layer, instead of silently feeding an un-mixed stream slice to lm_head. - final_norm_rows names its BF16 element size, documents its precondition and skips the copy when input and output alias. - Tests exercise the invariant (mixer layer last, GDN last, no hyper- connections, unaffected models) instead of a string equality. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
GB10 gate, part 1 (reiner job 527): PASS. main
Argmax is unchanged, as expected: every per-position logit scale is positive. The probabilities are what was wrong. Part 2 (merge gate), reiner job 538, next after the train job: ST-995 via |
|
Merge gate, part 2 (reiner job 538). ST-995: PASS, and better than main. 86.23 / 86.81 against bars of 82.72 / 81.65. Paired against main's job 464 (84.92 / 84.93, same recipe, verify-active): +1.31 points; 24 fixed vs 11 broken; exact McNemar p = 0.041. Greedy picks did move, as expected: the recipe's presence penalty now applies on correctly scaled logits. Perf leg: INVALID (a harness transport failure, not the engine). Re-running.
This merges when the perf leg is valid and clean. |
|
Perf leg rerun (reiner job 595): invalid again, for a transport reason, not the server. The Mac client lost its network at 18:07Z (Tailscale reported `Network is unreachable`). At that point 207 of 1007 turns had completed, and every turn after that failed on the client side. On the server side: 209 requests done, 0 errors, 0 watchdog events, 0 KV exhaustion, and 202 of 207 prefix hits restored from a snapshot. It was still answering `/v1/models` afterwards. I've installed the endpoints harness on reiner itself (same tree and `uv.lock`) and requeued the leg as `596z-perf-legs-local`, with the client running on the same box as the server. This removes the Mac hop that has now broken two runs. One caveat for the comparison against job 465 (0.491): that run's client sat behind the Mac→reiner tunnel, so this one sees slightly lower per-request latency. |
|
Both gates pass. Merging.
About the red checks:
The perf client for this run ran on the same box as the server, while job 465's ran through the Mac tunnel. Part of the +0.014 may come from that lower client latency, so I'm not claiming a speedup. Correctness is the claim. |
A merge rather than a rebase: other people use this branch, so no force-push. The two final-norm commits (Atlas-Inf#111) are now on main, so they drop out of this PR's diff against main; their duplicates stay in the branch history. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…) into Atlas-Inf#100 Carries main into this PR through Atlas-Inf#91, again as a merge (no force-push). The final-norm fix is on main now, so it drops out of the diff against main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Split out of #91 so the fix can land before the EXL3 work. Both commits are @andrew-vogulkin's, cherry-picked unchanged with authorship kept:
0fcb18bd4→4de31c095and8860eddee→98fbc6320.The bug
qwen4_exp(Qwen3.8-Flash-Next), the last layer's model-level hyper-connection mixer is already the model's final normalization.(1 + w)kernel. That rescaled each position's logits by2 / rms(x).ppl.py/kl_driftmeasurement on Flash-Next.The change
final_norm_rowsreplaces the 18 final-norm call sites: prefill last-token, prompt logprobs, decode, batched decode, and the verify paths. It does a stream-ordered D2D copy whenfinal_norm_identityis set, and the unchanged RMSNorm otherwise.ModelConfig::final_norm_is_identityis the single source of truth. It's true only forqwen4_exp.Evidence from #91
5b07b953: decode 19.70 = 19.70 tok/s, 2,048-token time-to-first-token 3.15 = 3.15 s.Gate for this PR
Follow-up
Every Flash-Next perplexity number quoted in #74 and #70 was measured on rescaled logits. Relative A/B verdicts should hold, but magnitudes need a re-baseline after this merges.
Refs #91, #65.
🤖 Generated with Claude Code