pytorch/helion

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

What it solves

Helion simplifies the creation of high-performance machine learning kernels for GPUs. It addresses the complexity of writing raw Triton code by providing a higher level of abstraction, reducing the manual effort required for memory indexing, masking, and grid management, and automating the tedious process of performance tuning (autotuning).

How it works

Helion is a Python-embedded domain-specific language (DSL) that allows users to write kernels using PyTorch-like syntax. It uses hl.tile to subdivide iteration spaces into tiles that execute in parallel on the GPU. These kernels are then compiled down to Triton (or optionally TileIR or CuTe) backends.

A key feature is its extensive autotuner, which evaluates hundreds of potential implementations—varying block sizes, loop orders, and indexing strategies—to find the most efficient configuration for a specific hardware target and input shape.

Who it’s for

It is designed for developers and researchers who need to write custom, optimized GPU kernels but want to avoid the low-level manual boilerplate of Triton or the complexity of CUDA C++.

Highlights

  • Automated Tuning: Automatically optimizes block sizes, loop reordering, and PID mappings to maximize performance.
  • PyTorch Integration: Uses standard PyTorch operators (like torch.addmm) which are mapped to Triton operations via TorchInductor.
  • Reduced Boilerplate: Automates tensor indexing, masking, and kernel argument management.
  • Multiple Backends: Supports Triton, NVIDIA's TileIR (for Blackwell GPUs), and an experimental CuTe backend.
  • Performance Portability: Uses a large search space during autotuning to make kernels more efficient across different hardware.

相关

  • 项目
  • 项目
  • 项目
  • Dispatch
  • 项目