Apple's MLX lands kernel optimizations: 2~3x batched decoding, ~2x small-prompt prefill

awnihannun · x · 2026-10-29

zcbenz summarized a batch of recent optimizations merged into Apple's MLX framework: sliding window attention built into fused SDPA (with array-mask support), mma/nax QMV making batched decoding 23x faster, direct fp4-to-fp16 dequantization for 1.4x faster prefill on older Macs, a 2-stage nax QMM kernel for 2x faster small-prompt prefill, 1-bit affine quantization, thin GEMM kernels (1.5x), and 1.4x faster fused SDPA via K/V prefetching. He recommends browsing MLX's commit history for aspiring open source contributors.

Original post →

More from Infra

Infra channel →