Skip to content

Commit 08eec2a

Browse files
committed
feat(model): Laguna-S-2.1 W6 — KV cache + incremental decode → 5.05x decode, token-identical to W5
Replace W5's O(n^2) STATELESS full-recompute (LagunaForwardGguf re-runs the whole prompt+context for every token) with a per-layer K/V cache + single-token incremental-decode forward (LagunaForwardGgufCached). LagunaKvCache (laguna.h) mirrors DeepseekV4KvCache, extended from MLA's single deck latent to GQA multi-head K/V. Per layer it caches the post-QK-RMSNorm / post-RoPE keys + raw values at f32 — bit-exact to the recompute because RoPE and QK-norm depend only on a token's own absolute position and Laguna attention is causal. MIXED attention handled per-layer: 12 GLOBAL layers keep the whole history (full causal); 36 SLIDING-WINDOW-512 layers EVICT rows beyond the 512 window (gemma2/3 is_sliding) and advance first_pos, capping their K/V. The attention inner loop and the FFN block are extracted into shared helpers (LagunaAttention/LagunaFfnBlock/LagunaEmbed/LagunaFinalLogits) called by BOTH forwards, so the two paths run identical float ops; the stateless path's ids are unchanged after the refactor. examples/laguna_gen gains --stateless (force W5 recompute) for the A/B gate; default is the W6 KV-cache path. GATE (real 3-shard UD-Q4_K_XL GGUF, GB10, --gpu, keep-quant, greedy, 24 tokens): TOKEN-IDENTICAL — the two paths' generated ids are BYTE-EQUAL (md5 754728c6.. match) and both equal the W5 golden. Decode 3.33 -> 0.66 s/tok = 5.05x (stateless per-step grew 0.68s->5.08s, the O(n^2) signature; cached is flat ~0.66 s/tok). No cache bug — bit-exact on the first run. Build laguna-gen only, tests OFF, tree cleaned. Records: spec + STATUS + BENCHMARKS + model-matrix. All checkers rc=0. FOLLOWING_AGENTS_PROTOCOL Assisted-by: Claude Code:claude-opus-4-8 [ClaudeCode]
1 parent 6e75928 commit 08eec2a

7 files changed

Lines changed: 522 additions & 119 deletions

File tree

.agents/model-matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Engaged architectures (the 43 non-`INVENTORIED` rows):
7979
|| `Glm4MoeLiteForCausalLM` | GLM-4.7-Flash (31.2B MLA + GLM MoE) | SACRED gate 8/8 vs vLLM 0.25.0 (STRICT token-exact 1/8 + near-tie-band 7/8, 69/128 tokens strictly exact, max teacher-forced gap 0.0 nats, 0 forward-divergent; vLLM K=5 self-deterministic → STRICT bar); FIRST e2e coverage of the q_lora query branch AND the noaux_tc sigmoid router (closes the MLA campaign's two gaps, C2); speed pending | `MODEL-TEXT-glm4-moe-lite-glm4-moe-lite-for-causal-lm` |
8080
| 📋 | `KimiLinearForCausalLM` | Kimi-Linear | MLA half unlocked by the shared MLA campaign; the full model is not gated, row stays `SPIKE` | `MODEL-TEXT-kimi-linear-kimi-linear-for-causal-lm` |
8181
| 📋 | `KimiK3ForConditionalGeneration` | Kimi K3 (2.8T MoE + MoonViT-V2, DERIVE-AND-SHIP) | **W2/W5 CPU scaffolding landed** (registry stub + nested text/vision/quant config descent + text-backbone structural name-map + REFUSE-by-name forward + MXFP4-refuse loader; clean CPU build, scaffold gate 6/6). text backbone IS `KimiLinearForCausalLM` (KDA+MLA+MoE hybrid, HEAVY reuse); **does NOT fit GB10 (~1.56 TB MXFP4, ~12×)** and NOT in the pinned oracle ⇒ no on-box golden — DERIVED, proxy-gated on Kimi-Linear-48B; forward + MXFP4 + KDA delta + MoonViT-V2 not implemented (NOT-YET-BUILDABLE) | `MODEL-MM-kimi-k3-kimi-k3-for-conditional-generation` |
82-
| ✅ | `LagunaForCausalLM` | Poolside Laguna-S-2.1 (118B/8B MoE) | **RUNNABLE (W5, 2026-07-31): our engine greedy-generates COHERENT text on the REAL 3-shard UD-Q4_K_XL GGUF (GB10 keep-quant) — "The capital of France is" → " Paris. …", first token "Paris." matches the llama.cpp-Poolside reference. Multi-shard GGUF reader + keep-quant tower (`LoadLagunaFromGgufShards`) + `LagunaForwardGguf` (ds4 keep-quant Gemm/GemmRowSlice) + `examples/laguna_gen`; load 20.6s, peak 71 GiB, 3.27 s/tok stateless recompute (speed=W6).** Prior W3: **W3 REAL forward + 3 new ops landed** (`laguna_ops.cpp`: per-head softplus attn out-gate + ungrouped sigmoid-noaux router + dual per-layer RoPE cos/sin builders; `LagunaModel::Forward` now a REAL runnable host-reference composition — variable-Q-head GQA + dual RoPE + sliding-window mask + softplus gate + dense L0 / ungrouped-MoE L1..47 + untied lm_head — replacing the W1/W2 `VT_CHECK(false)` stub; CPU `-Werror` full-library build clean; `test_laguna_scaffold` **8/8·166** incl. softplus math, router selection+tie-break RED-first, dual-RoPE cos/sin bit-match, variable-Q-head shapes, forward composition on synthetic weights; `test_model_registry` 24/24). W1 oracle DECISION: vLLM native `laguna.py` in pin ⇒ config constructs; dual-oracle = vLLM-NVFP4/-FP8 (fits GB10, BF16 235 GiB does NOT) + llama.cpp-Q4_K token-exact. DEFERRED to W4 (needs 73 GB checkpoint): GGUF keep-quant tower materialization + device/paged production forward + strict dual-oracle greedy gate. ~85-90% reuse (ds4-MoE + gemma-sliding + olmo3-dual-rope + landed Q4_K keep-quant); NEW = the 3 landed host ops + name-map + variable-Q-head device runner. **W4 (2026-07-31, `CLAIM-LAGUNA-W4`, in progress):** the UD-Q4_K_XL GGUF (73.4 GiB, 3 shards) FETCHED to dgx + its metadata/tensor-map READ AUTHORITATIVELY (814 tensors, arch `laguna`, `expert_gating_func=2` sigmoid, `leading_dense_block_count=1`, `expert_weights_scale=2.5`). Three CPU-verified FIDELITY corrections the W1-W3 scaffold got wrong, each grounded in the real GGUF + llama.cpp: (1) **per-head QK-RMSNorm** (`attn_q_norm`/`attn_k_norm` F32[128]) added to params+forward — the scope MISSED it (surfaces only in the tensor map); (2) **dual-RoPE mscale** now uses llama.cpp's `yarn_attn_factor·(1+0.1·ln(factor))` off the GGUF-authoritative `factor=32`/`yarn_attn_factor=1.0` (256K-ctx build, NOT HF's factor-128/1.4852 1M-ctx scalar) — resolves the numerics-delicate residual; (3) **separate** `ffn_gate_exps`/`ffn_up_exps` (Q4_K) + `ffn_down_exps` (Q5_K) + Q8_0 shared/attn (the scaffold assumed merged gate_up). GGUF keep-quant tower materialization (`Mw`/`Sew` mirror of ds4) + keep-quant `ForwardGguf` (vt::MatmulBT/GemmRowSlice) + the real-model greedy run vs the llama.cpp-laguna same-quant oracle remain the W5 close (73 GB single-GB10, host-orchestrated) | `MODEL-TEXT-laguna-laguna-for-causal-lm` |
82+
| ✅ | `LagunaForCausalLM` | Poolside Laguna-S-2.1 (118B/8B MoE) | **RUNNABLE + FAST DECODE (W6, 2026-07-31): a per-layer K/V cache + single-token incremental decode replaces W5's O(n²) STATELESS recompute — TOKEN-IDENTICAL (byte-equal ids, md5 `754728c6…` match, == the W5 golden) and 5.05× faster per token: decode 3.33 → 0.66 s/tok on the real UD-Q4_K_XL GGUF (GB10, `--gpu`, keep-quant), same " Paris.…" text. `LagunaKvCache` (mirrors `DeepseekV4KvCache`, MLA-latent → GQA multi-head K/V; caches post-QK-RMSNorm/post-RoPE K + raw V at f32 — bit-exact since RoPE/QK-norm are position-only and attention is causal), MIXED attention per-layer: 12 GLOBAL layers grow unbounded + 36 SLIDING-WINDOW-512 layers EVICT rows beyond the 512 window (gemma2/3 `is_sliding`); `LagunaForwardGgufCached` + shared `LagunaAttention`/`LagunaFfnBlock` helpers used by BOTH forwards (identical float ops; recompute ids unchanged after refactor), `examples/laguna_gen --stateless` A/B flag. No cache bug (bit-exact first run). Next speed = grouped-expert GEMM + device-resident decode (both in-tree from ds4). See `.agents/specs/laguna-s21-w6-2026-07-31.md`. Prior RUNNABLE (W5, 2026-07-31): our engine greedy-generates COHERENT text on the REAL 3-shard UD-Q4_K_XL GGUF (GB10 keep-quant) — "The capital of France is" → " Paris. …", first token "Paris." matches the llama.cpp-Poolside reference. Multi-shard GGUF reader + keep-quant tower (`LoadLagunaFromGgufShards`) + `LagunaForwardGguf` (ds4 keep-quant Gemm/GemmRowSlice) + `examples/laguna_gen`; load 20.6s, peak 71 GiB, 3.27 s/tok stateless recompute (speed=W6).** Prior W3: **W3 REAL forward + 3 new ops landed** (`laguna_ops.cpp`: per-head softplus attn out-gate + ungrouped sigmoid-noaux router + dual per-layer RoPE cos/sin builders; `LagunaModel::Forward` now a REAL runnable host-reference composition — variable-Q-head GQA + dual RoPE + sliding-window mask + softplus gate + dense L0 / ungrouped-MoE L1..47 + untied lm_head — replacing the W1/W2 `VT_CHECK(false)` stub; CPU `-Werror` full-library build clean; `test_laguna_scaffold` **8/8·166** incl. softplus math, router selection+tie-break RED-first, dual-RoPE cos/sin bit-match, variable-Q-head shapes, forward composition on synthetic weights; `test_model_registry` 24/24). W1 oracle DECISION: vLLM native `laguna.py` in pin ⇒ config constructs; dual-oracle = vLLM-NVFP4/-FP8 (fits GB10, BF16 235 GiB does NOT) + llama.cpp-Q4_K token-exact. DEFERRED to W4 (needs 73 GB checkpoint): GGUF keep-quant tower materialization + device/paged production forward + strict dual-oracle greedy gate. ~85-90% reuse (ds4-MoE + gemma-sliding + olmo3-dual-rope + landed Q4_K keep-quant); NEW = the 3 landed host ops + name-map + variable-Q-head device runner. **W4 (2026-07-31, `CLAIM-LAGUNA-W4`, in progress):** the UD-Q4_K_XL GGUF (73.4 GiB, 3 shards) FETCHED to dgx + its metadata/tensor-map READ AUTHORITATIVELY (814 tensors, arch `laguna`, `expert_gating_func=2` sigmoid, `leading_dense_block_count=1`, `expert_weights_scale=2.5`). Three CPU-verified FIDELITY corrections the W1-W3 scaffold got wrong, each grounded in the real GGUF + llama.cpp: (1) **per-head QK-RMSNorm** (`attn_q_norm`/`attn_k_norm` F32[128]) added to params+forward — the scope MISSED it (surfaces only in the tensor map); (2) **dual-RoPE mscale** now uses llama.cpp's `yarn_attn_factor·(1+0.1·ln(factor))` off the GGUF-authoritative `factor=32`/`yarn_attn_factor=1.0` (256K-ctx build, NOT HF's factor-128/1.4852 1M-ctx scalar) — resolves the numerics-delicate residual; (3) **separate** `ffn_gate_exps`/`ffn_up_exps` (Q4_K) + `ffn_down_exps` (Q5_K) + Q8_0 shared/attn (the scaffold assumed merged gate_up). GGUF keep-quant tower materialization (`Mw`/`Sew` mirror of ds4) + keep-quant `ForwardGguf` (vt::MatmulBT/GemmRowSlice) + the real-model greedy run vs the llama.cpp-laguna same-quant oracle remain the W5 close (73 GB single-GB10, host-orchestrated) | `MODEL-TEXT-laguna-laguna-for-causal-lm` |
8383
| 🚫 | `DeepseekV3ForCausalLM` / `DeepseekV32ForCausalLM` | DeepSeek-V3 / V3.2 | HW-blocked (671B, ~642 GiB fp8 vs 119 GiB unified memory); V3.2 additionally DEP-blocked (DSA indexer) | `MODEL-TEXT-deepseek-v2-deepseek-v3-for-causal-lm` |
8484
| 🚫 | `GlmMoeDsaForCausalLM` | GLM-5 (DSA) | HW-blocked (1404 GiB bf16) and DEP-blocked (GLM-5.x is DeepSeek-V3.2 verbatim) | `MODEL-TEXT-deepseek-v2-glm-moe-dsa-for-causal-lm` |
8585
| 🚫 | `MiniMaxM2ForCausalLM` | MiniMax-M2 | HW-blocked (~230B / ~428 GiB bf16, ~4x over unified memory) | `MODEL-TEXT-minimax-m2-mini-max-m2-for-causal-lm` |
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Laguna-S-2.1 (`LagunaForCausalLM` / `laguna`) — W6: KV cache + incremental decode → 5× decode
2+
3+
**Row:** `MODEL-TEXT-laguna-laguna-for-causal-lm` — stays **RUNNABLE / ACTIVE** (speed step).
4+
**Claim context:** `CLAIM-LAGUNA-W6`. **Date:** 2026-07-31. **Base:** W5 `6e75928a`.
5+
**HW:** dgx.casa GB10 (sm_121a), 119 GiB unified. **Branch:** `laguna-s21-w6-kvcache` (NOT pushed).
6+
7+
W6 kills the O(n²) full-recompute. W5 made Laguna RUNNABLE but `LagunaForwardGguf`
8+
is a STATELESS whole-sequence recompute (re-runs the entire prompt+generated
9+
context for EVERY token). W6 adds a per-layer K/V cache + a single-token
10+
incremental-decode forward that is **TOKEN-IDENTICAL** to the W5 recompute (a pure
11+
FLOP-equivalence, bit-exact by construction) and ~5× faster per decoded token.
12+
13+
## Result (the honest finish — same binary, A/B on the real GGUF)
14+
15+
`examples/laguna-gen`, real 3-shard `unsloth/Laguna-S-2.1-GGUF UD-Q4_K_XL` (GB10,
16+
`--gpu`, keep-quant), greedy, prompt "The capital of France is", 24 tokens:
17+
18+
```
19+
STATELESS (W5, --stateless): ids 22345 83 350 785 989 395 13259 330 4159 9431 377 340 4328 377 444 136 22029 9626 71 493 6396 565 7760 10291 TPOT 3.33 s/tok (decode 76.60s/23, prefill 1.37s)
20+
KV-CACHE (W6, default): ids 22345 83 350 785 989 395 13259 330 4159 9431 377 340 4328 377 444 136 22029 9626 71 493 6396 565 7760 10291 TPOT 0.66 s/tok (decode 15.10s/23, prefill 1.47s)
21+
```
22+
23+
- **TOKEN-IDENTICAL GATE: PASS.** The two paths' `generated ids` lines are
24+
BYTE-EQUAL (identical md5 `754728c6…`), and both equal the recorded W5 golden
25+
verbatim. A KV cache changes nothing numerically when correct — this is the
26+
bit-exact-by-construction proof, and it held on the FIRST run (no cache bug).
27+
- **SPEED: 3.33 → 0.66 s/tok decode = 5.05× faster.** The stateless path's
28+
per-step time GREW with context (step 1 = 0.68s … step 23 = 5.08s: the O(n²)
29+
signature); the cached decode is FLAT ~0.66–0.69 s/tok regardless of context.
30+
- Load 48.1s (cold, drop_caches), peak resident 71.09 GiB (119 GiB pool). Worker
31+
down, `flock $HOME/gpu.lock`, one model resident.
32+
33+
## Design — the KV cache + incremental decode
34+
35+
`LagunaKvCache` (`laguna.h`) mirrors `DeepseekV4KvCache`, extended from MLA's
36+
single `deck` latent to GQA multi-head K/V. Per layer it stores the POST-QK-RMSNorm
37+
/ POST-RoPE keys and the RAW values at f32 (bit-exact to the W5 recompute); a
38+
`len` counter is the global position of the next token; `first_pos[layer]` is the
39+
global position of the layer's first cached row (advanced by sliding eviction).
40+
41+
`LagunaForwardGgufCached` (`laguna.cpp`) is the same keep-quant composition as
42+
`LagunaForwardGguf` but binds the cache:
43+
- **Prefill** (first call, `cache.len==0`): all prompt tokens, positions 0..P-1.
44+
Projects q/k/v for all P rows, qk-norms + RoPEs them, APPENDS the K/V to each
45+
layer's cache, then attends (the existing full O(P²) masked attention).
46+
- **Decode** (later calls, T=1): ONE new token at position `cache.len`. Projects
47+
its q/k/v, qk-norms + RoPEs, APPENDS the single K/V row, attends the new query
48+
over the layer's cached K/V. Global positions `0..len`.
49+
50+
**Why it is bit-exact:** RoPE and QK-RMSNorm depend only on a token's OWN absolute
51+
position, and Laguna attention is causal, so a token's hidden state (and thus its
52+
K/V) depends only on tokens `0..j` — identical whether recomputed at step j+1 or
53+
at any later step. Caching the post-RoPE K + raw V therefore reproduces exactly
54+
what the recompute would recompute. To guarantee identical FLOAT ops (not just
55+
"mathematically equal"), the attention inner loop and the FFN block are EXTRACTED
56+
into shared helpers (`LagunaAttention`, `LagunaFfnBlock`, `LagunaEmbed`,
57+
`LagunaFinalLogits`) that BOTH forwards call — the two paths run the same code,
58+
differing only in the K/V source (fresh projections vs cache) and the query set
59+
(all T rows vs the one new row). The gate confirms the recompute path is unchanged
60+
(its ids still match the W5 golden after the refactor).
61+
62+
### The NEW bit — MIXED attention: global vs sliding-window eviction
63+
64+
Laguna is 12 GLOBAL layers (full causal) + 36 SLIDING-WINDOW-512 layers. Cache
65+
handling is per-layer (grounded in gemma2/3 `is_sliding`):
66+
- **Global layers** (`window==0`): cache grows unbounded — the whole history is
67+
kept; `first_pos` stays 0.
68+
- **Sliding layers** (`window==512`): after appending the new row, if the row
69+
count exceeds 512 the oldest rows are EVICTED from the front of the flat K/V
70+
vectors and `first_pos` advances by the drop count. A query at global position
71+
`pi` scores only kv with `pi - pj < window`, so once >512 rows are cached the
72+
oldest can never be scored again — evicting them is exact, and it caps the
73+
sliding-layer K/V at the 512-token window (the memory win). The attention still
74+
applies the `pi - pj >= window` mask, so correctness does not depend on the
75+
eviction firing (for the 6+24-token gate the window is never exceeded, so
76+
eviction is a no-op here and the sliding cache holds all rows — the code path is
77+
present and unit-safe; a >512-ctx run is the future exercise of the eviction).
78+
79+
Per-layer variable Q-head count (48 global / 72 sliding) and GQA group flow
80+
through unchanged — only KV heads (8) and head_dim (128) are cached, which are
81+
uniform across layers.
82+
83+
## Driver
84+
85+
`examples/laguna_gen` gained `--stateless` (force the W5 O(n²) recompute for the
86+
A/B gate). Default is the W6 KV-cache path: step 0 prefills the whole prompt
87+
(local logits index = last row), later steps feed ONE new token at `positions =
88+
{kv.len}` with local logits index 0. Env: no new flags for correctness; the
89+
existing `--gpu` routes the keep-quant GEMMs to the GB10.
90+
91+
## Gate + build
92+
93+
- **Build (disk-aware):** CUDA `RelWithDebInfo -DVLLM_CPP_CUDA=ON
94+
-DVLLM_CPP_CUDA_ARCHITECTURES=121a -DVLLM_CPP_CUTLASS_DIR=$HOME/cutlass-4.5.0
95+
-DVLLM_CPP_TRITON=ON -DVLLM_CPP_BUILD_TESTS=OFF`, target `laguna-gen` only
96+
(cutlass found, FA2 enabled). Engine lib + example built RC=0; build tree
97+
cleaned after (2.7 GiB, box restored).
98+
- **Correctness gate:** TOKEN-IDENTICAL PASS (byte-equal ids, md5 match, both ==
99+
W5 golden). No cache bug found — the shared-helper design was bit-exact first try.
100+
- **Speed:** decode 3.33 → 0.66 s/tok (5.05×), prefill unchanged (~1.4s).
101+
102+
## Residuals (future speed)
103+
104+
0.66 s/tok is still host-orchestrated per-token per-expert GEMV over the keep-quant
105+
tower. The next throughput levers (both already in-tree from ds4):
106+
`MatmulBTQuantGrouped` grouped-expert GEMM + a device-resident decode chain
107+
(`ForwardResidentDecodeGguf`/decode CUDA-graph analog). Token-exact-vs-llama.cpp on
108+
the shared quant is the remaining correctness tightening. The O(n²)→O(n) recompute
109+
kill (this row) is the dominant decode win and is landed + gated.
110+
111+
## Decision
112+
113+
Row stays **RUNNABLE / ACTIVE**. The KV-cache incremental decode is token-identical
114+
to the W5 recompute (byte-equal, proven on the real bytes) and 5× faster per token.
115+
Not fabricated: both id streams are recorded verbatim and their md5s match.

docs/BENCHMARKS.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,43 @@ when the era is rolled up; this page never accumulates their run-by-run history.
1616
House style: honest measured numbers only, and no em-dashes (use commas,
1717
periods, parentheses, or hyphens), matching the README.
1818

19+
## Laguna-S-2.1 (`LagunaForCausalLM`) W6 — KV cache + incremental decode: 5.05× faster, token-identical (2026-07-31, `CLAIM-LAGUNA-W6`)
20+
21+
W6 kills W5's O(n²) stateless full-recompute. A per-layer K/V cache
22+
(`LagunaKvCache`) + a single-token incremental-decode forward
23+
(`LagunaForwardGgufCached`) attends each new token over cached K/V instead of
24+
re-running the whole context every step. Same binary A/B on the real 3-shard
25+
`UD-Q4_K_XL` GGUF (GB10, `--gpu`, keep-quant), greedy, prompt "The capital of
26+
France is", 24 tokens (drop_caches, `flock`, one model resident, worker down):
27+
28+
```
29+
$ laguna-gen --model Laguna-S-2.1-UD-Q4_K_XL-00001-of-00003.gguf --gpu --stateless --max-tokens 24 # W5
30+
ids 22345 83 350 785 989 395 13259 330 4159 9431 377 340 4328 377 444 136 22029 9626 71 493 6396 565 7760 10291
31+
prefill 1.37s | decode 76.60s | TPOT 3.33 s/tok over 23 steps (per-step GREW 0.68s→5.08s: the O(n²) signature)
32+
33+
$ laguna-gen --model Laguna-S-2.1-UD-Q4_K_XL-00001-of-00003.gguf --gpu --max-tokens 24 # W6 (default, KV-cache)
34+
ids 22345 83 350 785 989 395 13259 330 4159 9431 377 340 4328 377 444 136 22029 9626 71 493 6396 565 7760 10291
35+
prefill 1.47s | decode 15.10s | TPOT 0.66 s/tok over 23 steps (FLAT ~0.66–0.69 s/tok, context-independent)
36+
```
37+
38+
- **TOKEN-IDENTICAL GATE: PASS.** The two `generated ids` lines are BYTE-EQUAL
39+
(identical md5 `754728c6…`) and both equal the recorded W5 golden — a KV cache
40+
changes nothing numerically when correct. Bit-exact on the first run; no cache
41+
bug. The recompute path itself is unchanged (shared `LagunaAttention`/
42+
`LagunaFfnBlock` helpers; its ids still match the W5 golden after the refactor).
43+
- **SPEED: decode 3.33 → 0.66 s/tok = 5.05×.** Prefill unchanged (~1.4s), peak
44+
resident 71.09 GiB (119 GiB pool).
45+
- **Mechanism:** post-QK-RMSNorm/post-RoPE K + raw V cached at f32 (RoPE/QK-norm
46+
are position-only, attention is causal → the cached K/V equal what the recompute
47+
recomputes). MIXED attention per-layer: 12 GLOBAL layers keep full history; 36
48+
SLIDING-WINDOW-512 layers EVICT rows beyond the 512 window (gemma2/3
49+
`is_sliding`) — the memory cap; the `pi-pj≥window` mask keeps correctness
50+
independent of eviction (window not exceeded at 30 ctx tokens, so eviction is a
51+
no-op here — the >512-ctx exercise is future).
52+
- **Next speed (owed, not this row):** grouped-expert GEMM + device-resident
53+
decode chain (both in-tree from ds4); token-exact-vs-llama.cpp tightening.
54+
- See `.agents/specs/laguna-s21-w6-2026-07-31.md`.
55+
1956
## Laguna-S-2.1 (`LagunaForCausalLM`) W5 RUNNABLE — real keep-quant GGUF forward, coherent on GB10 (2026-07-31, `CLAIM-LAGUNA-W5`)
2057

2158
W5 makes Laguna **RUNNABLE**: `examples/laguna-gen` loads the REAL 3-shard unsloth

0 commit comments

Comments
 (0)