Files
vetta-infer/crates
adm b9cac6d0df [LD][GW] Fix systematic token-2+ parity gap: per-pass KV cache + unpadded logit vocab
Two root causes found by bisecting the pos-27/28 forward against strata-inkling
(per-visit cur-norm dumps, STRATA_INK_NORM/POS, reverted after):

1. KV cache was shared across the 3 core loop passes. The reference assigns a
   DISTINCT KV pool per visit (visit_kv_slot: 40 SWA + 8 global), so each core
   pass reads its own KV history. Sharing one cache corrupted multi-token
   attention from the first core visit (visit6) onward. LayerState.k_cache/
   v_cache are now [DeviceBuf; 3] indexed by pass (prelude/coda use pass 0).

2. Served/logit vocab used the PADDED size (201024). Padding tokens >= the
   unpadded vocab (200058) carry arbitrary logits and outranked real tokens
   (e.g. 200193 beat end_message 200010). Engine now uses unpadded_vocab,
   matching strata k_unembed_softcap V = vocab_unpadded.

Verified: chat parity EXACT vs reference for 16 and 40 greedy tokens, both
F32 (default) and FP16 KV. pos-28 per-visit norms now agree to ~3e-3 (was
diverging by 50-80). Added serve_gen_multi_token_parity GPU regression.

Suite: workspace -D warnings green; 18 ld + 18 hip + 4 gw GPU; 5 Lean 0 sorryAx.
2026-12-01 18:04:01 +01:00
..