Verba/Rapida

Esperimenti #90b

The fused 8-bit KV decode read ported to Gemma 4: `gemma4MoeAttnWith` (Lesto `src/transformer.zig:31148` at...

done

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

Cosa è stato provato

The fused 8-bit KV read ported to Gemma 4: `gemma4MoeAttnWith` (Lesto `src/transformer.zig:31148` at `r102`) gains the `kvAttnFusedEligible` branch the other paths have, for decode width at head dims 256 and 512, on a Lesto branch `row/90b`; first timing-free step: check the fused kernel's head-dim support and bit against the dequantized read on the M4

Modello e configurazione

the best

Guadagno atteso

+4 to +7% decode at 8k (inferred from 88p: half the KV bytes)

Da dove viene l'idea

row 90

Esito

done 2026-11-02 (screen, LESTO ade9afa5): the port works (parity tests, engaged lines) but `--kv-quant 8` itself costs 23% (1k) to 30% (8k) decode on Gemma 4, and the fused read recovers none of it; fusing the sliding layers costs 46%. Closed; lesson in the README

Lezione

halving KV bytes is a decode lever only where the cache's own per-step cost is below the bytes it saves: on Lesto's Gemma 4 path an 8-bit cache costs 23% at 1k, where it saves almost nothing, so screen the quantized path's fixed cost at a short context before porting a fused read for it.

Adottato

no (screen: the 8-bit cache loses 23 to 30% decode, the fused read recovers none of it)

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