Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels
by PyTorch (Meta)
Write GPU kernels in PyTorch-style Python with hl.tile and let Helion's autotuner search the Triton configurations for you.
Overview
Helion describes itself as "PyTorch with tiles", or a higher-level Triton: you write a kernel as ordinary PyTorch operations inside an hl.tile loop, and Helion generates the Triton code, handling tensor indexing, most masking, grid sizing, PID-to-tile mapping and optimizations such as PID swizzling, persistent kernels and warp specialization. The docs at helionlang.com are split into Installation, Examples, Tutorials, an API Reference with a Settings page, a Deployment guide for autotuning, a TileIR backend page and an Events page. The guided tutorial starts with the structure of a kernel (host code, the hl.tile device loop, device operations) and then works through ten problems: constant add, outer vector add, a fused outer multiply with ReLU and its hand-written backward pass (Helion does not generate backward kernels for you), long sum, three-pass long softmax, a simple FlashAttention with online softmax, 2D convolution, batched matmul, and a 4-bit quantized matmul. It closes by autotuning a matmul and hardcoding the winning helion.Config. The examples gallery holds 59 kernels, including fp8 and nvfp4 GEMMs, grouped GEMM, Blackwell and flex attention, a GRPO loss, Mamba2 chunk scans, jagged-tensor ops and distributed all-gather matmul. Requirements are Linux, Python 3.10 to 3.14, PyTorch 2.9+, Triton 3.5+ and an NVIDIA GPU with compute capability 8.0+ or AMD with ROCm 6.2+. Version 1.0.0 shipped on PyPI on April 3, 2026 and 1.5.0 on October 12, 2026, so the docs track an actively released library maintained in the pytorch/helion repository.
At a Glance
- Topic
- ML
- Level
- Advanced
- Format
- Documentation
- Cost
- Free
- Duration
- Self-paced; the 10-problem guided tutorial takes roughly a day of hands-on work on a GPU (estimate), plus as long as you want in the 59-kernel examples gallery
- Provider
- PyTorch (Meta)
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Structure a Helion kernel as host code plus an hl.tile device loop of PyTorch operations
- ✓Let the autotuner search block sizes, loop orders and indexing modes instead of enumerating Triton configs
- ✓Hardcode a tuned helion.Config so production runs skip the roughly ten-minute first-run autotune
- ✓Write reductions such as long sum and three-pass softmax over tiled sequences
- ✓Implement a simple FlashAttention kernel with online softmax for numerical stability
- ✓Write a 4-bit quantized matmul that unpacks int32-packed weights and dequantizes per group
- ✓Hand-write backward kernels and wrap Helion kernels for use in PyTorch training
- ✓Debug generated code with HELION_PRINT_OUTPUT_CODE, HELION_PRINT_REPRO and HELION_AUTOTUNE_EFFORT settings
Highlights
- •The 59-kernel examples gallery covers current LLM workloads: fp8 and nvfp4 GEMMs, Blackwell attention, flex attention, GRPO loss, Mamba2 and MoE matmul
- •Runs on both NVIDIA (compute capability 8.0+) and AMD ROCm GPUs; AMD publishes its own Helion notebook benchmarking softmax against Triton, Aiter and Torch on an MI300X
- •The PyTorch launch post drew 150 points and 49 comments on Hacker News in November 2025, and the repo has 965 stars and 2,710 commits
- •Separates autotuned Config (block sizes, warps, indexing) from non-tuned Settings, and documents ahead-of-time tuning for production deployment
- •A Colab softmax notebook lets you try a kernel on a free GPU before installing anything
Who It’s For
Best For
- ✓ML engineers who need a custom fused kernel and find raw Triton config tuning tedious
- ✓Inference and training engineers optimizing attention, normalization or quantized GEMMs for specific hardware
- ✓Triton users who want the same kernels to stay portable between NVIDIA and AMD GPUs
- ✓Engineers studying how a modern kernel DSL and autotuner are put together
Prerequisites
- •Solid PyTorch, including tensor shapes, broadcasting and autograd
- •Working knowledge of GPU kernel concepts such as tiling, memory bandwidth and reductions; prior Triton experience helps
- •A Linux machine with an NVIDIA GPU of compute capability 8.0+ or an AMD GPU on ROCm 6.2+ (or a Colab GPU for the notebook)
FAQ
What is Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels?
The official documentation for Helion, a Python-embedded DSL from the PyTorch team that compiles ML kernels down to Triton. It is for ML engineers who already write PyTorch and want custom fused kernels (attention, normalization, quantized GEMMs, losses) without hand-enumerating Triton block sizes. You come away able to write, autotune, pin and ship your own kernels.
Is Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels free?
Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels is free to access.
What level is Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels for?
Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels is aimed at a advanced audience. Recommended background: Solid PyTorch, including tensor shapes, broadcasting and autograd, Working knowledge of GPU kernel concepts such as tiling, memory bandwidth and reductions; prior Triton experience helps, A Linux machine with an NVIDIA GPU of compute capability 8.0+ or an AMD GPU on ROCm 6.2+ (or a Colab GPU for the notebook).
How long does Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels take?
Expect roughly Self-paced; the 10-problem guided tutorial takes roughly a day of hands-on work on a GPU (estimate), plus as long as you want in the 59-kernel examples gallery. Most learners work through it at their own pace.
What will I learn from Helion Documentation — PyTorch's Python DSL for Autotuned ML Kernels?
You'll learn: Structure a Helion kernel as host code plus an hl.tile device loop of PyTorch operations; Let the autotuner search block sizes, loop orders and indexing modes instead of enumerating Triton configs; Hardcode a tuned helion.Config so production runs skip the roughly ten-minute first-run autotune; Write reductions such as long sum and three-pass softmax over tiled sequences; Implement a simple FlashAttention kernel with online softmax for numerical stability; Write a 4-bit quantized matmul that unpacks int32-packed weights and dequantizes per group; Hand-write backward kernels and wrap Helion kernels for use in PyTorch training; Debug generated code with HELION_PRINT_OUTPUT_CODE, HELION_PRINT_REPRO and HELION_AUTOTUNE_EFFORT settings.
Topics
Sources
This page was written from 8 sources, 4 on domains other than helionlang.com.