Verba/Rapida

Esperimenti #89

A faster single-token SDPA for Gemma 4's head dims 256 and 512 on the best: probe 88p measured SDPA alone...

screen

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

Cosa è stato provato

A faster single-token SDPA for Gemma 4's head dims 256 and 512 on the best: 88p measured SDPA alone at 1.79 ms per step at 1k (about 60 us per layer, nearly fixed: 2.05 ms at 8k) while its KV bytes are a small share; read MLX's SDPA kernel (`sdpa_vector` and its 2-pass variant, the D=512 path) for the fixed cost, then a lossless or rounding-checked kernel (one dispatch for all heads, split-K tuned to small contexts)

Modello e configurazione

the best

Guadagno atteso

+8 to +15% decode (inferred: most of 1.8 ms)

Da dove viene l'idea

row 88

Esito

screen done 2026-10-31 (89s): the one-dispatch GQA kernel loses to MLX's 2-pass above 1,024 keys and changes 10 of 20 1k replies below; -0.8% at 1k; not adopted; leads rows 91 and 92

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