
Triton
A language and compiler for writing fast custom GPU deep-learning kernels in Python-like code.
- Stars
- 20.5k
- Forks
- 3.4k
- Licence
- MIT
- Language
- MLIR
- Last update
- 4 days ago
- Type
- Dev tool
What it is
Triton is a language and compiler for writing custom low-level routines (called kernels) used in deep learning, such as specialized matrix operations. The project aims to let programmers write fast GPU code more easily than with CUDA, while being more flexible than other domain-specific languages. This repository is the development home of Triton, and the README points to official documentation for installation and tutorials.
- Install the released package with pip and write a custom deep-learning kernel
- Debug kernel code step by step by running with the Triton interpreter (TRITON_INTERPRET=1)
- Dump intermediate representations before each compiler pass to inspect what Triton generates
- Build Triton from source to modify the compiler or test changes
Great for
- Machine learning engineers writing custom GPU operations for PyTorch-based models
- Researchers who want to experiment with fast kernels without writing raw CUDA
- Developers who want to try Triton's interpreter to run kernel code without a GPU
- Students learning how GPU kernels and compiler stages fit together
Not ideal for
- People who only need to train or run existing models and never write custom kernels, since they would not need a compiler for this
- Users who need a turnkey, fully documented test suite, because the README says there is no simple way to run all tests
- Anyone wanting a stable API for building on LLVM directly, because the README notes LLVM has no stable API and Triton may not build against arbitrary LLVM versions
How to get it
- 1
Install with a package manager
You'll need: Python with CPython 3.10 to 3.14 · pip · For source builds: git and a Python virtual environment
Install latest stable release from pip
pip install tritonClone the repository for a source install
git clone https://github.com/triton-lang/triton.gitInstall build-time dependencies and Triton in editable mode
pip install -r python/requirements.txt && pip install -e . - 2
Run it
- Run pip install triton to get the latest stable release
- Write a small kernel using Triton's Python API, following the official documentation tutorials
- Optionally set TRITON_INTERPRET=1 to run the kernel without a GPU and step through it in Python
- 3
Get the most out of it
- Use TRITON_INTERPRET=1 to debug kernels with Python breakpoints when no GPU is available
- Set MLIR_ENABLE_DUMP to inspect IR before each MLIR pass, and MLIR_DUMP_PATH to save the output to a file
- Use TRITON_REPRODUCER_PATH to capture an MLIR reproducer when a compiler stage fails
- Set TRITON_BUILD_WITH_CLANG_LLD=true for faster source builds, and TRITON_BUILD_WITH_CCACHE=true to use ccache
Downloads
Strengths
- Installs from pip with prebuilt wheels for CPython 3.10 to 3.14, so most users skip building from source
- Interpreter mode lets kernel code run without a GPU and allows Python breakpoints
- Rich debugging knobs such as IR dumps and reproducer files help diagnose compiler failures
Trade-offs
- Build-from-source steps are involved, including build-time dependencies and optional custom LLVM builds that the README says can take a while
- The README says there is no turnkey way to run all tests, so contributors must follow a manual recipe
- Its own documentation is the main source for installation details, and the README here is truncated
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.