M5 Ultra LLM tip: set prefill step to 8192 for up to 45% faster throughput

bakawolf123 · reddit · 2026-09-25

A practical tuning tip for running LLMs locally on the M5 Ultra: set --prefill-step-size 8192. The step size affects both prefill performance and the drafter fetching logits for MTP (also affects dflash; mlx-vlm needs a small patch for chunked prefill with dflash).

The value must be large enough to fill all cores but not so large it adds extra dispatches.

Benchmarks with GLM-flash-4bit + MTP show clear gains at 8k vs 2048: on 131k prompt tokens, prompttps 735.5 vs 623.6 and generationtps 71.1 vs 50.8 (185s vs 220s total); gains at 32k context are even larger (1056 vs 860 prompttps).

Caveat: some engines like omlx support adaptive step size — qwen3.8-flash-next starting at 2048 on omlx matches 8k performance at 64k+ context and even runs 10% better on smaller contexts — but that's not universal.

Original post →

More from Infra

Infra channel →