Verba/Rapida

Esperimenti #82

Engine code audit of the best's decode step: host time per step (mlx-serve `MLX_SERVE_STEP_TRACE`), a Metal...

done

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

Cosa è stato provato

Engine code audit of the best's step: host time per step (mlx-serve `MLX_SERVE_STEP_TRACE`), a Metal System Trace of 8k decode, and a read of every serialized weight read per layer in `src/transformer.zig`; each lossless fix found becomes a row (`docs/experiments/2026-10-31-mac-engine-audit/README.md`)

Modello e configurazione

the best

Guadagno atteso

accounts for the ~3 ms overhead the 2.3 ms gap to 100 lies in (diagnostic)

Da dove viene l'idea

rows 57p, 59, 61, 80

Esito

done 2026-10-31: 98% busy in decode, host build 0.6 ms hidden; the overhead is dependent barrier levels per layer; candidates C (KV write in the RoPE kernel), B+F (router in seam1, GeGLU epilogue), G (norms in the matmul tail) queued as rows 83 to 85

Lezione

on the M4 Pro the Mac best's decode GPU is 98% busy and the host build is hidden, so the overhead is the GPU's dependent levels inside a layer (full-scope barriers between small kernels), not host time or dispatch count: count barrier levels per layer, not dispatches, when sizing a fusion.

Adottato

no (diagnostic).

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