Helion, PyTorch’s DSL for machine-learning kernels, is adding compile-time heuristics to choose settings without running autotuning first. This could reduce the wait involved in tuning kernels across many shapes. PyTorch says the resulting performance came close to fully autotuned configurations in the cases it tested.
The heuristics inspect a kernel’s intermediate representation and dataflow, then classify it as a matrix multiplication, reduction, or pointwise operation. They use that classification to select settings such as block sizes, warp counts, and pipeline stages. According to the post, the new selection does not apply when dimensions are unknown at compile time; Helion then uses its previous default. The analysis itself adds negligible compilation overhead, PyTorch reports.
On an H100 GPU, the computed configuration was 1.18 times as fast as Flash Linear Attention’s handwritten Triton kernels in forward-pass tests covering nine linear-attention variants. Across six vLLM reduction kernels, it was 1.27 times as fast as vLLM’s handwritten CUDA/C++ operators. These results cover the kernel and shape tests described in the post, not arbitrary workloads.
The heuristics also estimate resource use, including registers and shared memory; PyTorch notes that these estimates are approximate. Its post explains the selection rules and provides further benchmark comparisons: the original PyTorch article
🇬🇧 https://pytorch.org/blog/fast-by-default-compile-time-heuristics-for-helion-kernels