pytorch /helion

A Python-embedded DSL that makes it easy to write fast, scalable ML kernels with minimal boilerplate.

★ 997⑂ 198👁 15⑃ 4,463● 318▤ 42
PythonBSD-3-ClauseCreated 2025-04-22
Download: v1.6.0v1.6.0 ↓1.6.02026-11-15
+0
Daily
+3
Weekly
997
stars
198
forks
15
watchers
4,463
prs
318
issues
42
releases

README

About

📚 View Documentation 📚 |
🎥 Watch Talk 🎥 |
🚀 Try In Colab 🚀 |
Try In AMD DevCloud

Helion is a Python-embedded domain-specific language (DSL) for
authoring machine learning kernels. A Helion kernel expresses an algorithm
as PyTorch operations over tiles; the compiler derives a configuration
space for each kernel and hardware target and autotunes it, so the same
kernel adapts across input shapes and hardware targets.

 Backends

On NVIDIA B200 or B300, set HELION_BACKEND=cute for better performance.
Use PyTorch built with CUDA 13 or later and install the
CuTe dependencies.

Helion supports the following code generation backends. These status labels
refer to Helion's integration with each compiler.



| Backend (HELION_BACKEND) | Status | Hardware and when to choose it |
| --- | --- | --- |
| Triton (triton, default) | Stable | General-purpose GPU backend for NVIDIA and AMD; other targets require a compatible Triton distribution. |
| CuTe DSL (cute) | Beta | NVIDIA GPUs, with Blackwell-focused optimizations. Recommended for B200/B300 performance; requires CUDA 13+ PyTorch and the pinned CuTe dependencies. |
| TileIR (tileir) | Stable | NVIDIA Blackwell (compute capability 10.x or 12.x), through Triton-to-tile-IR. Requires its Triton distribution and ENABLE_TILE=1. |
| Pallas (pallas) | Beta | Google TPUs through JAX/Pallas. CPU interpret mode is available for development. |
| Gluon (gluon) | Experimental | NVIDIA Blackwell (compute capability 10.x), using Triton's Gluon compiler. Requires Triton 3.8+. |
| Metal (metal) | Experimental | Apple GPUs through Metal Shading Language, using PyTorch MPS tensors on macOS. |
| FlyDSL (flydsl) | Experimental | AMD GPUs through FlyDSL and ROCm; requires the separate flydsl package. |



Select a backend with HELION_BACKEND before importing your kernels, or use
@helion.kernel(backend="cute") for a per-kernel choice. The decorator
argument takes precedence; Triton remains the default. Helion autotunes
within the selected backend, so retune when switching backends or hardware.

See the Backend Guide for status definitions, setup,
limitations and guidance on choosing a backend.

[Triton]: https://github.com/triton-lang/triton

The name Helion refers to the nucleus of a helium-3 atom, while Triton
refers to hydrogen-3.

Helion can be viewed as PyTorch with tiles. Compared to writing kernels directly in a
lower-level language such as Triton, Helion reduces manual coding effort through autotuning.
Helion spends more time autotuning as it evaluates hundreds of potential
implementations generated from a single Helion kernel. This larger search space also makes
kernels more performance portable between different hardware. Helion automates and autotunes over:

1. Tensor Indexing:

    Automatically calculates strides and indices.
    Autotunes choices among various indexing methods (pointers, block pointers, TensorDescriptors).
    Supports per-operation indexing strategies for fine-grained memory access control of

Top issues

Latest release

v1.6.0 v1.6.0 2026-11-15
What's Changed
 [bench] Direct baseline adapters allocate their output per call by @jansel in https://github.com/pytorch/helion/pull/4214
 [cutedsl] Zero-fill elision and host full-sum tail: constexpr branches, chained loop ranges, sum / scalar by @jansel in https://github.com/pytorch/helion/pull/4215
 [cutedsl] cute_pdl: the cute_pdl_spread pad, tcgen05 release after each role wait, the flash-backward surface by @jansel in https://github.com/pytorch/helion/pull/4216
 [cutedsl] Packed half atomics in the collective epilogue; fp16 atomic outputs accumulate in fp16 by default by @jansel in h

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON