ML Systems & Infrastructure

operator-fusion compiler

Writing every fused kernel by hand does not scale to the thousands of operator combinations a model can produce. An operator-fusion compiler takes the whole computation graph and decides automatically which neighboring operators to merge into single kernels, then generates that fused code. It turns the human art of fusion into a compiler pass over the graph.

Such a compiler partitions the graph into fusion groups — typically clustering elementwise and reduction ops around the producers and consumers of large tensors, while leaving library calls like GEMM and convolution as fixed nodes whose epilogues can still be fused. It reasons about which intermediates can stay on chip, schedules the loops, picks tile sizes, and emits device code, often through a backend such as Triton or LLVM. The hard parts are the fusion-boundary decision (fuse too much and you spill or lose parallelism; too little and you keep paying memory traffic) and handling reductions and broadcasts, whose iteration spaces do not line up trivially.

This is the engine inside XLA, TorchInductor, TVM, and similar stacks; it is what lets a high-level model definition run near hand-tuned speed without anyone writing kernels. The fusion choices it makes are precisely the ones that raise arithmetic intensity and cut launch overhead across an entire network.

Also called
graph compiler算子融合編譯器圖編譯器