MLX merges compiler fusion PR: horizontal+vertical fusion to speed up training

awnihannun · x · 2026-11-29

MLX merged a major JIT compiler improvement (PR #4953 by nastya236). The old implementation only greedily fused vertical producer→consumer chains, missing element-wise kernels reading the same inputs. The new approach starts with one group per op and gradually merges both vertically and horizontally, producing fewer kernels — critical for backward passes due to activation gradients and recomputation (à la torch.compile). The refactor also splits compile.cpp into separate files; the author disclosed using Muse and GLM 5.3 4bits for parts of the implementation.

Original post →

More from Infra

Infra channel →