Verba/Rapida

Esperimenti #154

Prefill chunks stop evaluating the last layer's output: the MoE forward's cadence evaluates `h` after layer...

done

Il testo degli esperimenti resta in inglese, come l'ha scritto il laboratorio.

Cosa è stato provato

chunks stop evaluating the last layer's output: the forward's cadence evaluates `h` after layer 29 of every chunk of 1,024 or more (`src/transformer.zig:9920-9921`), though the chunk loop frees the chunk's logits unevaluated and reads only the KV entries (`src/generate.zig:1831-1836`, `:1847-1861`); so every chunk computes layer 29's head-dim-512 composed SDPA, `o_proj`, dense MLP and MoE for all its rows and drops them. Fix: in a chunk whose output nothing reads (no logprobs, no DFlash or hidden capture) skip that eval, so the KV eval computes only layer 29's K and V; kill switch `MLX_SERVE_R154_OFF`; lossless, identical replies by construction (`2026-11-13-mac-engine-audit/README.md` F1)

Modello e configurazione

the best

Guadagno atteso

cold first token -4% to -5% (0.29 to 0.36 s of 7.26 s, inferred from row 106's split), turn-1 reply -3.3% to -4.1%, per-turn paired reply -0.6% to -0.7% (row 109a's ratio); 0

Da dove viene l'idea

engine audit 2026-11-13

Esito

done 2026-11-13: on the pre-registered metric, reply median per turn -0.0% [-0.1, -0.0] against 0.3% (turn 1 -4.0%, summed reply -2.72%, cold first token -4.8%), 150 of 150 identical; a lossless stack candidate (LESTO `row/154` 079d832b on lesto-dev, with rows 158 and 159) (`2026-11-13-mac-engine-audit/README.md`)

Lezione

skipping the last layer's eval on prefill chunks whose output nothing reads cuts every cold prompt by 4.8% (0.35 s at 6k tokens) with all 150 replies identical, but a per-turn median cannot see a change that touches only turn 1; a cold-prompt saving is scored on turn 1 or on summed time, and is kept as a lossless stack component.

Adottato

no (no gain on the pre-registered metric; a lossless stack candidate kept on lesto-dev, scored stacked with rows 158 and 159)

Vuoi vedere cosa hanno prodotto questi esperimenti? Lesto, il motore di inferenza per Gemma 4 sui Mac con Apple silicon, è su lestoengine.com

Creato da Federico Andrioli, @fedeandri su X Le misure di un laboratorio di ricerca, ricavate direttamente dai suoi file. Dati aggiornati al