Verba/Rapida

Experiments #90b

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

done

What was tested

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

Model and setup

the best

Expected gain

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

Where the idea came from

row 90

Outcome

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

Lesson

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.

Adopted

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

Want to see what these experiments produced? Lesto, the Gemma 4 inference engine for Apple silicon Macs, is on lestoengine.com

Made by Federico Andrioli, @fedeandri on X A research lab's own measurements, generated from its files. Data built