PyTorch's Helion Now Uses LLMs to Autotune Kernels 10x Faster — With Zero Performance Loss
LLM-guided autotuning matches LFBO quality while testing 10x fewer configurations.
Helion, PyTorch's domain-specific language for writing high-performance ML kernels, relies heavily on autotuning to find optimal configurations (tile sizes, block sizes, num_warps, etc.) across diverse hardware. Its current default autotuner uses Likelihood-Free Bayesian Optimization (LFBO), which trains a Random Forest classifier on the fly to guide the search. While effective, LFBO still requires hundreds of compile-and-benchmark cycles per kernel, limiting developer velocity and production deployment.
To dramatically reduce tuning time, the PyTorch team introduced an LLM-guided autotuner. In each round, the LLM receives the kernel code, workload details, and the best configurations found so far, then proposes new configurations for benchmarking. On 33 test cases across B200 GPUs, the LLM-guided search matches LFBO's performance (geomean 1.009X) while compiling/benchmarking ~10x fewer configs and reducing wall-clock time by ~6.7x. For the rare kernels where the LLM trails by >5%, a hybrid strategy seeds LFBO with the LLM's best config, closing the gap while remaining ~3x cheaper than pure LFBO. The results are largely model-independent—Opus-4.8, gpt-5.5, and Sonnet-4.6 perform within a few percent of each other—proving LLM-guided autotuning is a practical, production-ready approach for accelerating kernel tuning.
- LLM-guided autotuner matches LFBO performance (geomean 1.009X) while benchmarking ~10x fewer configurations.
- Total wall-clock time for tuning is reduced by ~6.7x, with a hybrid LLM+LFBO strategy remaining ~3x cheaper than pure LFBO.
- The method is model-independent: Opus-4.8, gpt-5.5, and Sonnet-4.6 yield nearly identical results, enabling flexible deployment.
Why It Matters
Reduces kernel tuning from minutes to seconds, accelerating ML development on any hardware without sacrificing performance.