Repolode
triton-lang

triton-lang/triton

A language and compiler for writing highly efficient custom deep-learning GPU kernels in Python-like code, with higher productivity than CUDA.

Open-source alternative to:CUDA

Stars
20,533
Forks
3,377
Open issues
1,372
Last commit
7 hours ago

What is it?

Triton is a language and compiler for writing custom deep-learning primitives, the low-level kernels that run on GPUs. It aims to let developers write fast kernels with more productivity than CUDA while keeping more flexibility than other domain-specific languages.

The project is installable from pip with binary wheels for CPython 3.10 through 3.14, and can also be built from source against a custom or prebuilt LLVM. It targets NVIDIA GPUs (Compute Capability 8.0+) and AMD GPUs (ROCm 6.2+), with CPU support listed as under development. Supported platform is Linux.

The repository also provides a Triton interpreter, which runs kernels without a GPU and allows Python breakpoints inside kernel code. A set of environment-variable knobs exposes IR dumps for each MLIR and LLVM pass, kernel override, reproducer generation, and autotuning output for debugging and performance work.

Key features

  • 01Write GPU kernels in a Python-based language with tile-level abstractions.
  • 02Runs kernels on NVIDIA and AMD GPUs.
  • 03Includes an interpreter mode that runs without a GPU and supports Python breakpoints.
  • 04Dumps IR at each MLIR and LLVM compilation stage for inspection.
  • 05Supports kernel override and out-of-tree compiler plugins.

Use cases

  • Writing custom fused operators or attention kernels for deep-learning models.
  • Optimizing GPU kernels with higher productivity than hand-written CUDA.
  • Debugging kernel logic on a machine without a GPU using the interpreter.
  • Studying or extending the MLIR-based compiler pipeline for GPU code generation.

Quick start

  1. 1

    Install the latest stable release from pip

    pip install triton
  2. 2

    Or install from source: clone the repository

    git clone https://github.com/triton-lang/triton.git
  3. 3

    Install build-time dependencies from the source tree

    pip install -r python/requirements.txt
  4. 4

    Install Triton in editable mode

    pip install -e .

Things to know

  • Building from source requires a local LLVM toolchain setup or a prebuilt LLVM download during the build.
  • Running the GPU test suite requires a GPU, though an interpreter mode runs without one.

In collections

Topics

FAQ

What is triton?
A language and compiler for writing highly efficient custom deep-learning GPU kernels in Python-like code, with higher productivity than CUDA. Triton is a language and compiler for writing custom deep-learning primitives, the low-level kernels that run on GPUs. It aims to let developers write fast kernels with more productivity than CUDA while keeping more flexibility than other domain-specific languages.
Is triton free to use? What license does it have?
triton is open source under the MIT license. Check the license terms before using it in commercial products.
Is triton still maintained?
Actively maintained. The last commit to triton was on Nov 7, 2026.
What can I use triton for?
Writing custom fused operators or attention kernels for deep-learning models. Optimizing GPU kernels with higher productivity than hand-written CUDA. Debugging kernel logic on a machine without a GPU using the interpreter. Studying or extending the MLIR-based compiler pipeline for GPU code generation.
How do I install triton?
Install the latest stable release from pip: pip install triton Or install from source: clone the repository: git clone https://github.com/triton-lang/triton.git Install build-time dependencies from the source tree: pip install -r python/requirements.txt Install Triton in editable mode: pip install -e .
Where can I get triton?
The source code and installation instructions are on GitHub: https://github.com/triton-lang/triton

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects

An open-source book and code collection of modern CUDA learning notes, with 200+ kernels covering HGEMM, FP8/FP4 GEMM, and Flash-Attention.

Learning Resources#cuda#gpu#tensor-cores
12.2K+17 this week1.3KCudaGPL-3.0Updated 19 hours ago