Verba/Rapida

Experiments #96

The tree's MLX from 0.32.3 to 0.32.5 or main with the lab's patches re-applied: PR 4596 (TK=4 unroll in the...

screen

What was tested

The tree's MLX from 0.32.3 to 0.32.5 or main with the lab's patches re-applied: PR 4596 (TK=4 unroll in the 2-pass vector SDPA, 1.04x to 1.06x at GQA 2 reported) and PR 4734 (native sliding-window SDPA, no dense mask read past the window); screen identical replies (rounding expected in SDPA)

Model and setup

the best

Expected gain

+1 to +3% at 8k (inferred)

Where the idea came from

sweep 2026-10-31

Outcome

screen done 2026-10-31 (96): ; MLX main regresses 7% / 32% / 44% at 1k / 8k / 16k through PR 4596's TK=4 at head dim 512 (TK=1 restores r102's speed); replies change for an unidentified upstream reason; not adopted

Lesson

a upstream SDPA speedup measured on other shapes (TK=4, PR 4596) costs Gemma 4 up to 44% at 16k on its head-dim-512 layers: re-screen every MLX upgrade on all of the model's head dims and context lengths before adopting it.

Adopted

no (no gain with the regression fixed; replies change for an unidentified upstream reason).

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