Skip to content

Latest commit

 

History

History
190 lines (130 loc) · 4.57 KB

File metadata and controls

190 lines (130 loc) · 4.57 KB

Installation

System Requirements

Helion currently targets Linux systems and requires a recent Python and PyTorch environment:

Operating System

  • Linux-based OS
  • Other Unix-like systems may work but are not officially supported

Python Environment

  • Python 3.10–3.14
  • We recommend using uv for lightweight, fast virtual environments

Dependencies

  • PyTorch 2.11 or later

  • Triton 3.6 or later

    Note: Older versions may work, but will lack support for features like TMA on Hopper/Blackwell GPUs and may exhibit lower performance.

Installation Methods

Method 1: Install via pip

The easiest way to install Helion is from PyPI:

pip install helion

We also publish PyPI releases, but the GitHub version is recommended for the latest features and fixes.

Method 2: Development Installation

For development purposes or if you want to modify Helion:

# Clone the repository
git clone https://github.com/pytorch/helion.git
cd helion

# Install in editable mode with development dependencies
pip install -e '.[dev]'

This installs Helion in "editable" mode so that changes to the source code take effect without needing to reinstall.

Step-by-Step Setup Guide

1. Create and Activate a uv Virtual Environment

We recommend using uv to manage dependencies:

# Create a new virtual environment in .venv (one-time)
uv venv .venv

# Activate the environment
source .venv/bin/activate

2. Install PyTorch

Install PyTorch 2.11 or later:

# CUDA 12.8
pip install "torch==2.11.*" --index-url https://download.pytorch.org/whl/cu128

# ROCm 7.0
pip install "torch==2.11.*" --index-url https://download.pytorch.org/whl/rocm7.0

see PyTorch installation instructions for other options.

3. Install Triton

Install Triton 3.6 or later using one of the options below.

Option A: Prebuilt wheel (recommended)

# Install Triton from PyPI (will pick the right wheel for your platform if available)
pip install "triton>=3.6"

# Verify
python -c "import triton; print('Triton version:', triton.__version__)"

If a suitable wheel is not available for your platform, build from source:

Option B: Build from source (Ubuntu/Debian)

# Install build dependencies (adjust versions as needed)
sudo apt-get update
sudo apt-get install -y git clang-14 clang++-14 zlib1g-dev python3-dev

# (Optional) set compilers explicitly
export CC=clang-14
export CXX=clang++-14

# Clone and install Triton
git clone https://github.com/triton-lang/triton.git
cd triton
pip install -r python/requirements.txt
MAX_JOBS=$(nproc) TRITON_PARALLEL_LINK_JOBS=2 pip install .

# Verify and clean up
python -c "import triton; print('Triton version:', triton.__version__)"
cd ..

4. Install Helion

Choose one of the installation methods above:

# From PyPI
pip install helion

# Development installation
git clone https://github.com/pytorch/helion.git
cd helion
pip install -e '.[dev]'

Verification

Verify your installation by running a simple test:

import torch
import helion
import helion.language as hl

@helion.kernel(autotune_effort="none")
def test_kernel(x: torch.Tensor) -> torch.Tensor:
    out = torch.empty_like(x)
    for tile in hl.tile(x.shape[0]):
        out[tile] = x[tile] * 2
    return out

x = torch.randn(100, device='cuda')
result = test_kernel(x)
torch.testing.assert_close(result, x * 2)
print("Verification successful!")

Development Dependencies

If you installed with [dev], you get additional development tools:

  • pytest - Test runner
  • pre-commit - Code formatting and linting hooks

Set up and use pre-commit for linting:

# Install pre-commit hooks into your local git repo (one-time)
pre-commit install

# Run all checks across the repository
pre-commit run --all-files

Optional Dependencies

Documentation Building

To build documentation locally:

pip install -e '.[docs]'
cd docs
make html

GPU Requirements

Matches the requirements of Triton. At the time of writing:

  • NVIDIA GPUs (Compute Capability 8.0+)
  • AMD GPUs (ROCm 6.2+)
  • Via third-party forks: Intel XPU, CPU, and many other architectures

Next Steps

Once installation is complete:

  1. Check out the {doc}api/index for complete API documentation
  2. Explore the examples/ folder for real-world patterns