You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executes Tier D3 of the cross-arch merged-GEMM/glue fold plan
(.agents/specs/arch-fusion-fold-plan-2026-07-30.md). OLMo-2's FULL-WIDTH q/k
RMSNorm (_apply_qk_norm, olmo2.py:113-117,160-172 — RMSNorm over the WHOLE
q-dim/k-dim, all heads folded into ONE variance statistic, distinct from the
per-head head_dim norm) + standard NeoX RoPE preamble now folds onto the shared
vt::FusedChain glue catalog instead of a bespoke inline sequence.
The shape-param generalization: FStep gains a `norm_full_width` structural flag
(include/vt/fused_recipe.h, additive, default false = per-head Dh -> every
existing recipe byte-identical), and a NEW sibling recipe
kAttnQkNormRopeFullWidth (include/vt/recipes.h) sets it on its two RMSNorm steps
— the full-width variant of Qwen3-dense's kAttnQkNormRope, SAME operand table /
step wiring, only the bound norm SHAPE differs (operand 0/2 = [T,qdim]/[T,kdim]
with a full-width [qdim]/[kdim] weight, vs the per-head [.,Dh]/[Dh]).
olmo2.cpp Olmo2AttnBlock routes through vt::FusedChain(kAttnQkNormRopeFullWidth)
when RoPE runs from a cache (YaRN full-attn / default-ON bf16 cos-sin cache); the
in-place RopeNeox fallback (VT_QWEN3_ROPE_CACHE=0) keeps the standalone sequence
(mirrors the qwen3.cpp guard — the recipe's kRope is RopeFromCache). Realization
is composite-only (fast_op=kNoFastOp): the per-head kAttnQkNormRope bespoke fast
kernel (Metal) assumes a Dh reduction, so the full-width variant does not claim
it; a full-width fast kernel is a clean follow-up. Additive/inert:
kAttnQkNormRope (per-head, fast_op intact) is UNTOUCHED -> qwen3/27B
byte-identical.
Bit-exact by construction: because the Tier-0 composite's RmsNorm reduces over
the bound row's last dim (device-agnostic walker), the composite realizes the
full-width norm BYTE-EXACTLY with NO new primitive — it dispatches the EXACT
standalone RmsNorm(q,[qdim]) + RmsNorm(k,[kdim]) + RopeFromCache sequence OLMo-2
hand-called before the fold.
GATED (CPU RED-first, this box; VLLM_CPP_CUDA=OFF): tests/vt/test_ops_fused_chain
.cpp new case kAttnQkNormRopeFullWidth composite == full-width RmsNorm(q)+RmsNorm
(k)+RopeFromCache byte-compares (raw f32 memcmp) across MHA+GQA+head_dim 64/128,
RED-first (full-width proven DISTINCT from a per-head Dh norm). Full
test_ops_fused_chain suite 10/10 * 379 assertions GREEN under the new FStep ABI
(per-head kAttnQkNormRope regression + all 10 recipes intact -> shape-param is
additive). olmo2.cpp + the 26 CPU vt TUs rebuild -Werror clean.
OWED (DGX GB10 sm_121a, RelWithDebInfo + cutlass-4.5.0 + triton): the OLMo-2
SACRED token-exact gate test_olmo2_paged_engine (olmo2_greedy_1b 16/16) + shared-
catalog canaries test_qwen3_paged_engine 0.6B/4B + test_qwen27_paged_engine
235/235. NOT run this pass — executed on a CPU-only dev box (no GPU/cutlass, DGX
unreachable). Bit-exact by construction on CUDA (composite-only realization = the
identical device-agnostic walker the CPU byte-check pins; OLMo-2's committed
default rope path is cache-based -> the fold fires, composite == the pre-fold
standalone sequence), but a pass != the code ran, so the empirical DGX SACRED run
is owed before D3 is fully closed.
Records (same commit): docs/STATUS.md OLMo-2 row + docs/BENCHMARKS.md Tier-D3
section + arch-fusion-fold-plan-2026-07-30.md D3 marked DONE (code + CPU
bit-exact) with the DGX SACRED gate flagged OWED. All CPU record checkers rc=0
(fusion-consistency, agent-record, readme-structure, model-checklist, env-doc,
doc-checkpoint).
FOLLOWING_AGENTS_PROTOCOL
Assisted-by: Claude Code:claude-opus-4-8 [ClaudeCode]
Copy file name to clipboardExpand all lines: .agents/specs/arch-fusion-fold-plan-2026-07-30.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,10 @@ Extend the non-Marlin `MoeGroupedGemmNvfp4` path to the already-tuned fused-w13
107
107
**D2. GDN in_proj merge (qkv+z along N)***(shared-op: merged-QKV, GDN instance)*
108
108
Near-tie, distributionally sensitive; GDN layers are the majority of the 35B hybrid so it compounds — but verify token-exact gate. `qwen3_5.cpp:2952-2958`.
109
109
110
-
**D3. OLMo-2 full-width qk-norm+rope** — needs a **shape-param generalization** of `kAttnQkNormRope` (norm over qdim/kdim, not Dh). Bit-exact once the full-width dim is wired. `olmo2.cpp:110-115,131-139`.
110
+
**D3. OLMo-2 full-width qk-norm+rope** — ✅ **DONE (code + CPU RED-first bit-exact gate; DGX SACRED OWED) 2026-07-31** (branch `fold/d3-olmo2-fullwidth-qknorm` off `d21c442d`, NOT pushed).
111
+
OLMo-2's FULL-WIDTH q/k RMSNorm (`_apply_qk_norm`, olmo2.py:113-117,160-172: RMSNorm over the WHOLE q-dim/k-dim, all heads folded into one variance statistic) + standard NeoX RoPE preamble now folds onto the SHARED FusedChain catalog. **The shape-param generalization:** `FStep` gains a `norm_full_width` structural flag (`fused_recipe.h`, additive, default false = per-head Dh → every existing recipe byte-identical), and a new sibling recipe `kAttnQkNormRopeFullWidth` (`recipes.h`) sets it on its two RMSNorm steps — the full-width variant of Qwen3-dense's `kAttnQkNormRope`, same operand table/step wiring, only the bound norm SHAPE differs (operand 0/2 = `[T,qdim]`/`[T,kdim]` with a full-width `[qdim]`/`[kdim]` weight, vs the per-head `[.,Dh]`/`[Dh]`). Because the Tier-0 composite's `RmsNorm` reduces over the bound row's last dim, the composite realizes the full-width norm BYTE-EXACTLY with NO new primitive — it dispatches the EXACT standalone `RmsNorm(q,[qdim]) + RmsNorm(k,[kdim]) + RopeFromCache` sequence OLMo-2 hand-called before this fold. `olmo2.cpp` `Olmo2AttnBlock` (was `:110-115,131-139`) routes through `vt::FusedChain(kAttnQkNormRopeFullWidth, ...)` when RoPE runs from a cache (YaRN full-attn / default-ON bf16 cos-sin cache); the in-place `RopeNeox` fallback (`VT_QWEN3_ROPE_CACHE=0`) keeps the standalone sequence (mirrors the qwen3.cpp guard — the recipe's kRope is RopeFromCache, so routing RopeNeox through it would swap RoPE impls). Realization: **composite-only** (`fast_op=kNoFastOp`) — the per-head `kAttnQkNormRope` bespoke fast kernel (Metal) assumes a Dh reduction, so the full-width variant does not claim it; a full-width fast kernel is a clean follow-up perf step (§S4). The generalization is ADDITIVE: `kAttnQkNormRope` (per-head, fast_op intact) is untouched → qwen3/27B byte-identical.
112
+
-**GATED (CPU RED-first, this box):**`tests/vt/test_ops_fused_chain.cpp` new case `kAttnQkNormRopeFullWidth composite == full-width RmsNorm(q)+RmsNorm(k)+RopeFromCache` — byte-exact (raw f32 memcmp) across MHA + GQA + head_dim 64/128 shapes, RED-first discrimination (the full-width result is proven DISTINCT from a per-head Dh norm, so a wrong-domain realization fails). The FULL `test_ops_fused_chain` suite **10/10 · 379 assertions** GREEN under the new `FStep` ABI (the per-head `kAttnQkNormRope` regression + all 10 recipes intact → the shape-param is additive). `olmo2.cpp` + the vt runtime rebuild `-Werror` clean.
113
+
-**OWED (DGX GB10 sm_121a, RelWithDebInfo + cutlass-4.5.0 + triton):** the OLMo-2 SACRED token-exact gate `test_olmo2_paged_engine` (`olmo2_greedy_1b`, 16/16) + shared-catalog canaries `test_qwen3_paged_engine` 0.6B/4B + `test_qwen27_paged_engine` 235/235. NOT run in this pass — executed on a CPU-only box (`VLLM_CPP_CUDA=OFF`, no GPU/cutlass, DGX unreachable). Bit-exact BY CONSTRUCTION on CUDA (fast_op=kNoFastOp → the identical device-agnostic composite that the CPU byte-check pins; OLMo-2's committed default rope path is cache-based → the fold fires, composite == the pre-fold standalone sequence), but the empirical DGX SACRED run is still owed before D3 is considered fully gated (a pass ≠ the code ran).
111
114
112
115
### TIER E — MM-tower epilogues needing NEW recipes (towers furthest from parity; lowest ROI/site)
113
116
@@ -145,7 +148,7 @@ Every arch's MLP / QKV / MoE / attn-glue resolves through **one descriptor famil
At the end state, adding a new dense/MoE arch is *born fused*: pick the quant arm, bind the FusedChain recipes, no per-model GEMM+act copy. kimi_k3 is the proof — it inherits A2/A4/A5 with zero Kimi-specific work.
Tier-D3 of the cross-arch merged-GEMM/glue fold plan (`.agents/specs/arch-fusion-fold-plan-2026-07-30.md`). OLMo-2's FULL-WIDTH q/k RMSNorm (`_apply_qk_norm`, olmo2.py:113-117,160-172 — RMSNorm over the WHOLE q-dim/k-dim, all heads folded into ONE variance statistic, distinct from the per-head head_dim norm) + standard NeoX RoPE preamble folds onto the SHARED FusedChain glue catalog. **The shape-param generalization:** `FStep` gains a `norm_full_width` structural flag (`include/vt/fused_recipe.h`, additive, default false = per-head Dh → EVERY existing recipe byte-identical), and a new sibling recipe `kAttnQkNormRopeFullWidth` (`include/vt/recipes.h`) sets it on its two RMSNorm steps — the full-width variant of Qwen3-dense's `kAttnQkNormRope`, SAME operand table / step wiring, only the bound norm SHAPE differs (operand 0/2 = `[T,qdim]`/`[T,kdim]` with a full-width `[qdim]`/`[kdim]` weight, vs the per-head `[.,Dh]`/`[Dh]`). `olmo2.cpp` `Olmo2AttnBlock` routes through `vt::FusedChain(kAttnQkNormRopeFullWidth, ...)` when RoPE runs from a cache (YaRN full-attn layers / the default-ON bf16 cos-sin cache); the in-place `RopeNeox` fallback (`VT_QWEN3_ROPE_CACHE=0`) keeps the standalone sequence (mirrors the qwen3.cpp guard — the recipe's third step is RopeFromCache, so routing RopeNeox through it would swap RoPE impls). Realization: **composite-only** (`fast_op=kNoFastOp`) — the per-head `kAttnQkNormRope` bespoke fast kernel (Metal-registered) assumes a Dh reduction, so the full-width variant does not claim it; a full-width fast kernel is a clean follow-up perf step. **Additive/inert:** `kAttnQkNormRope` (per-head, fast_op intact) is UNTOUCHED → qwen3/27B byte-identical; the `norm_full_width` field defaults false so every prior recipe is unchanged.
112
+
113
+
**Bit-exact by construction, PROVEN on CPU.** Because the Tier-0 composite's `RmsNorm` reduces over the bound row's last dim (device-agnostic — the SAME walker on CPU and CUDA), the composite realizes the full-width norm BYTE-EXACTLY with NO new primitive: it dispatches the EXACT standalone `RmsNorm(q,[qdim]) + RmsNorm(k,[kdim]) + RopeFromCache` sequence OLMo-2 hand-called before the fold. `tests/vt/test_ops_fused_chain.cpp` new case `kAttnQkNormRopeFullWidth composite == full-width RmsNorm(q)+RmsNorm(k)+RopeFromCache` byte-compares (raw f32 memcmp) the composite against the standalone full-width sequence across MHA + GQA + head_dim 64/128 shapes, RED-first (the full-width result is proven DISTINCT from a per-head Dh norm, so a wrong-domain realization fails the byte-check). The FULL `test_ops_fused_chain` suite is **10/10 · 379 assertions** GREEN under the new `FStep` ABI (the per-head `kAttnQkNormRope` regression + all 10 catalog recipes intact ⇒ the shape-param is additive). `olmo2.cpp` + the CPU vt runtime rebuild `-Werror` clean.
114
+
115
+
Gate status:
116
+
- **CPU (this box, mudler-ubuntu-box, `VLLM_CPP_CUDA=OFF`):** `test_ops_fused_chain` **10/10 · 379** (D3 full-width case + per-head regression + all recipes), RED-first bit-exact. Build `-Werror` clean (olmo2.cpp fold + 26 vt CPU TUs rebuilt with the grown `FStep`).
117
+
- **DGX (GB10 sm_121a, RelWithDebInfo + cutlass-4.5.0 + triton) — OWED, NOT RUN this pass:** `test_olmo2_paged_engine` SACRED (`olmo2_greedy_1b`, 16/16) + shared-catalog canaries `test_qwen3_paged_engine` 0.6B/4B + `test_qwen27_paged_engine` 235/235. This lane executed on a CPU-only dev box (no GPU, no cutlass, DGX unreachable), so the empirical GPU SACRED run could not be performed. The fold is bit-exact BY CONSTRUCTION on CUDA (composite-only realization = the identical device-agnostic walker the CPU byte-check pins; OLMo-2's committed default rope path is cache-based ⇒ the fold fires and the composite == the pre-fold standalone sequence), but per project discipline a pass ≠ the code ran — the DGX SACRED gate is owed before D3 is fully closed.
118
+
119
+
Disposition: a shared-catalog consistency fold (OLMo-2 now resolves its qk-norm-rope preamble through the one FusedChain recipe family instead of a bespoke inline sequence); no isolated tok/s A/B (identical numerics, composite realization). The binding proof is the CPU RED-first byte-exact unit + (owed) the OLMo-2 SACRED gate holding on the DGX.
120
+
109
121
## bf16 merged-QKV default-ON — Tier-D1 (dense/coder/dflash/Gemma×4, 2026-07-31, `CLAIM-D1-BF16-MERGED-QKV`) - CONSISTENCY/LAUNCH-COUNT fold, CHARACTERIZED near-tie (0.6B golden regenerated), correctness-gated (no new throughput ratio owed)
110
122
111
123
Tier-D1 of the cross-arch merged-GEMM fold plan (`.agents/specs/arch-fusion-fold-plan-2026-07-30.md`). The q/k/v projections that SHARE the layer input collapse to ONE bf16 `vt::MatmulBT` over the merged `[qdim+2kdim,H]` owner + a contiguous `vt::QkvSplit` (the OLMo-2/Granite/StableLM exemplar), replacing three per-shard GEMMs (folds the two tiny GQA k/v GEMMs into one wide tensor-core GEMM, −2 launches/layer). The shared gate `Qwen3QkvMergeEnabled()` (alias `MergedQkvEnabled()`, env `VT_QWEN3_QKV_MERGE`) FLIPPED default-ON across all six bf16 consumers: qwen3_dense (`dense_attn_block.h`), qwen3_coder (inherits the shared dense `AttnBlock` via `qwen3_moe.cpp`), qwen3_dflash (`qwen3_dflash.cpp`), and Gemma-1/2/3/4 (`gemma*.cpp`). `=0` restores the byte-identical 3-shard path in the same binary. **No loader concat needed** — every consumer already packs the merged `qkv_proj` owner. RoPE handling UNCHANGED (no RopeNeox→RopeFromCache swap — the second-1-ULP-flip hazard from the fold plan §gaps.2 avoided). 27B/35B are UNTOUCHED (resident nvfp4/fp8 QKV, not this bf16 path).
| Gemma-2 dense (attn + final logit soft-cap) | Correctness-complete, speed-pending | Near-tie-band 48/48 (gemma-2-2b-it): 44/48 strict on vLLM's greedy + 4/48 at 0.0-nat ties in vLLM's own logits; proves the attention + final logit soft-cap primitives (attn_logit_softcapping 50 + final 30); the inverse of Gemma-3 (both soft-caps, no QK-norm) |
50
50
| Gemma-1 dense (the original Gemma) | Correctness-complete, speed-pending | STRICT token-exact 48/48 greedy (gemma-2b); two fused norms/layer, head_dim scale, GeGLU + sqrt(hidden) embed-scale, tied lm_head; no soft-cap/QK-norm/sliding. **D1 (2026-07-31): the whole Gemma family (1/2/3/4) folded to the default-ON bf16 merged-QKV descriptor (`MergedQkvEnabled`); re-gated Gemma-2 SACRED 48/48 (global+sliding) + Gemma-4 STRICT 32/32 — its existing gate held**|
51
-
| OLMo-2 dense (pure post-norm, full-width QK-norm) | Correctness-complete, speed-pending | Token-exact 16/16 (OLMo-2-0425-1B); first OLMo-family model; ZERO new compute kernel (pure post-norm `norm_after` + full-width QK-norm reuse existing ops); real ByteLevel-tokenizer gate (no BOS) |
51
+
| OLMo-2 dense (pure post-norm, full-width QK-norm) | Correctness-complete, speed-pending | Token-exact 16/16 (OLMo-2-0425-1B); first OLMo-family model; ZERO new compute kernel (pure post-norm `norm_after` + full-width QK-norm reuse existing ops); real ByteLevel-tokenizer gate (no BOS). **D3 (2026-07-31, `CLAIM-D3-OLMO2-FULLWIDTH-QKNORM`): the full-width q/k RMSNorm + RoPE preamble folds onto the SHARED FusedChain catalog** — new sibling recipe `kAttnQkNormRopeFullWidth` (the `norm_full_width` shape-param variant of Qwen3-dense's `kAttnQkNormRope`; `FStep.norm_full_width` additive, default false ⇒ every existing recipe byte-identical). Composite-only realization (`fast_op=kNoFastOp`) is byte-exact to the pre-fold standalone `RmsNorm(qdim)+RmsNorm(kdim)+RopeFromCache` sequence — CPU RED-first `test_ops_fused_chain` 10/10·379 GREEN (byte-exact, full-width proven distinct from per-head). **DGX SACRED (`olmo2_greedy_1b` 16/16) + qwen3/27B canaries OWED** — this lane ran on a CPU-only box (no GPU/cutlass); bit-exact by construction on CUDA (composite = the identical device-agnostic walker), empirical GPU run still owed. See docs/BENCHMARKS.md |
0 commit comments