Triton (OpenAI)
Python-embedded kernel language and compiler that turns block-level code into fast NVIDIA and AMD GPU kernels.
About
Writing a custom GPU kernel without dropping into CUDA C++ is the whole point of Triton, a Python-embedded kernel language and compiler that started as Philippe Tillet's Harvard research, matured at OpenAI and is now a community project with its own developer conference. You write a triton.jit function that works on blocks of data, and the MLIR and LLVM based compiler handles memory access patterns, on-chip memory and scheduling before emitting PTX for NVIDIA or AMDGCN for AMD hardware. Fused attention, matmul and normalization kernels fit in a few dozen lines, and PyTorch's torch.compile emits Triton code for GPUs, which is why Linux builds of PyTorch pull the package in. Prebuilt wheels install with pip for CPython 3.10 through 3.14; Linux is the supported OS, with NVIDIA GPUs of compute capability 8.0 or newer and AMD GPUs on ROCm 6.2 or later, while CPU support is still in progress. Setting TRITON_INTERPRET=1 runs kernels in a CPU interpreter, handy for debugging and for the Triton Puzzles. The MIT license permits commercial use. Meant for ML systems engineers and researchers chasing speed that stock libraries cannot reach.
Should you use Triton (OpenAI)?
Pick it when
Pick this when a custom fused operation is your bottleneck, such as a new attention variant or fused activation, and you want to write the GPU kernel in Python with tiling handled by the compiler instead of hand-written CUDA C++.
Look elsewhere when
If the operation already exists, use the tuned library: FlashAttention for attention, xFormers or Liger Kernel for fused blocks. Writing kernels still demands GPU performance knowledge and a supported GPU to test on.
Alternatives to Triton (OpenAI)
- FlashAttention
Ready-made exact attention kernels for Ampere and newer plus ROCm; use it instead of writing your own unless you need a novel variant.
- Liger Kernel
Prebuilt Triton kernels patched into Hugging Face models with one line; no kernel writing, but limited to the operations it ships.
- xFormers
Meta's library of optimized attention and fused transformer blocks; drop-in components rather than a language for new kernels.
- tinygrad
Generates fused kernels automatically through lazy evaluation; much less manual control than hand-written Triton kernels, but far less effort.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- AI Frameworks & Libraries
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Expert (5/5)
- License
- MIT
- Minimum VRAM
- 8 GB
- Added
- Apr 3, 2026