This feature thread tracks the evolution of kernel fusion techniques in NVIDIA CUDA to optimize GPU performance. Initial efforts focused on manual kernel fusion in CUDA C++ to reduce memory traffic and kernel launch overhead by combining multiple operations into a single kernel. Subsequent developments have explored implicit kernel fusion through compilers like PyTorch's Torch Inductor, which automatically fuses operations like element-wise transformations and reductions. This post details how custom fused MLP kernels, built with the CuTe DSL, address MoE bottlenecks by eliminating memory and synchronization overhead, enabling sync-free MoE execution with full-iteration CUDA graphs and achieving 1.3x-2x kernel-level speedup over unfused paths. These fused kernels support advanced GLU activation functions and quantization, and integrate with cuDNN Frontend, Transformer Engine, and Megatron Core, delivering significant end-to-end throughput improvements in pre-training setups.
All NVIDIA trails