Verba/Rapida

Esperimenti #30

Plain matmul-softmax-matmul for Gemma 4's head-dim-512 attention (overlay...

done

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

Cosa è stato provato

Plain matmul-softmax-matmul for Gemma 4's head-dim-512 (overlay `docs/experiments/2026-10-29-mac-d512-attention/overlay/sitecustomize.py`, PATCHED mlx-vlm 0.7.10): MLX's fused kernel takes 1.78 ms for MTP's 7-token verify over 8k keys, the plain ops 0.44 ms (max abs difference 0.00098); paired against `vlm_optiq_mtp` on the 50 sessions

Modello e configurazione

gemma-4-26b-a4b OptiQ-4bit + MTP assistant

Guadagno atteso

+8 to +15% decode (**guess**: 5 layers x 1.34 ms per verify step)

Da dove viene l'idea

rows 27, 28

Esito

done 2026-10-29: , +4.2% decode (interval +2.3 to +5.0, threshold 5%); SUSPICIOUS: reply +0.5% because the overlay also took chunks; row 30b limits it to queries of 16 or fewer: +5.8% (interval +4.9 to +6.5), replicated +5.7%, reply -1.0 to -1.5%; meaning read owed; row 31 tries the variable on the 1-user mlx-serve, running since 15:35 (`docs/experiments/2026-10-29-mac-d512-attention/`)

Lezione

route a kernel swap only to the query lengths it was measured on: the plain path helped decode queries but slowed prefill chunks.

Adottato

no (no gain)

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