Jargonautica
Making Models Smaller, Faster and Cheaper

Compilation and Kernel Fusion

Also called: Kernel Fusion, Graph Compilation

Rewriting the same computation so it runs faster on the hardware, without changing the result. Combining several small operations into one avoids repeatedly shuttling numbers between fast and slow memory, which is where most of the time actually goes.

Technical view

Graph compilers trace the model and apply operator fusion, memory planning, layout selection and constant folding, emitting optimised kernels. Fusion reduces memory traffic, which dominates cost since most operations are bandwidth-bound rather than compute-bound. Flash attention is a hand-written fused kernel of exactly this kind. Trade-offs include compilation time, recompilation on shape changes, and reduced flexibility for dynamic control flow.


Part of AI Terminology Index, section: Making Models Smaller, Faster and Cheaper.

How it connects

Compilation and Kernel Fusion links to 4 other terms. The faint lines are links between those terms. See it in the full graph.

Memory BandwidthMemory BandwidthArithmetic IntensityArithmetic IntensityFlash AttentionFlash AttentionInferenceInferenceCompilation and Kernel Fusion