Skip to content

Repository files navigation

Triton Extensions

build status discord chat

A collection of out-of-tree extensions for the Triton compiler, including passes, dialects, backends, and language extensions.

NOTE: this project is under construction. It is currently in the early stages of development and parts of it will likely change. Contributions are welcome but be aware that the foundations may change rapidly.

Overview

This repository provides a framework for developing and building Triton compiler extensions that can extend functionality without modifying the core Triton codebase. Extensions are built as shared libraries that can be dynamically loaded by Triton at runtime.

Extensions are built on top of the Triton plugin infrastructure documented upstream.

Slides from the January 2026 Triton Community Meetup: Triton Community Meetup: Triton Extensions Jan 2026

Structure

Each subdirectory's CMakeLists.txt is responsible for building its respective extensions.

  • backend/: Intended for backend extension implementations (currently scaffolding only).

  • dialect/: Intended for custom MLIR dialect extensions (currently scaffolding only).

  • language/: Intended for language extension implementations (currently scaffolding only).

  • pass/: Contains MLIR pass extensions. Each pass extension is implemented as a shared library that can be loaded dynamically. Pass extensions include a triton-ext.toml manifest that specifies the extension name and status.

  • extensions/: Contains standalone plugin extensions that bundle dialects, passes, and language bindings into self-contained shared libraries loadable by Triton at runtime.

    • utlx (µTLX): Triton Language Extensions plugin that provides most of Meta's TLX functionality without modifying the Triton fork. Includes local memory operations (local_alloc, local_view, local_store, local_load, alloc_barriers), custom passes (e.g., PingPong, PruneUnusedBarriers), the TLX dialect, conversion patterns, and a Python DSL. Builds libutlx.so.
  • support/: Contains extension infrastructure code to automatically register extensions with Triton.

Prerequisites

  • C++ compiler with C++17 support
  • CMake
  • GitHub CLI (gh), for downloading pre-built dependencies (optional)
  • Ninja
  • Python 3, for tests and build scripts; install dependencies with pip install -r requirements.txt
  • Triton, built with TRITON_EXT_ENABLED=ON

Note: Extensions are enabled by default in Triton releases 3.7 and beyond.

Build

This extension repository is designed to be built out-of-tree. It expects to be pointed to both LLVM (LLVM_INSTALL_DIR) and Triton (TRITON_INSTALL_DIR). Both directories should be installation directories, i.e., built and then packaged with make install.

To build the extensions:

  1. Build LLVM: Build LLVM as shared libraries and install it to a known location; see the CI action for reference. Alternately, download pre-built LLVM binaries from GitHub: run ci/download-artifact.py llvm [^list-artifacts].

  2. Build Triton: Build Triton and install it to a known location; see the CI action for reference. Alternately, download pre-built Triton binaries from GitHub: run ci/download-artifact.py triton [^list-artifacts].

[^list-artifacts]: GitHub artifacts are only available for a limited set of commits, OSes, and HW architectures. To list available artifacts, run ci/fetch-artifacts.py.

  1. Build extensions:

    export LLVM_INSTALL_DIR=/path/to/llvm/install
    export TRITON_INSTALL_DIR=/path/to/triton/install
    make build

    Note that if LLVM_INSTALL_DIR and TRITON_INSTALL_DIR are not set, the Makefile will helpfully search for them in the project directory. See the CI workflow for reference. Extensions are built as shared libraries under build/lib.

Test

Run the test suite to verify the extensions are working correctly:

make test

Use

Extensions are loaded by Triton at runtime using the TRITON_PLUGIN_PATHS environment variable (see Triton plugins):

export TRITON_PLUGIN_PATHS=/path/to/libmy_pass.so
python your_script.py

Some extensions are accessible from Python: e.g., the µTLX plugin automatically registers itself as triton.language.extra.tlx when imported, so no filesystem symlinks are needed:

export TRITON_PLUGIN_PATHS=/path/to/triton-ext/build/lib/libutlx.so
python your_script.py

To load multiple plugins, separate paths with ::

export TRITON_PLUGIN_PATHS=build/lib/libutlx.so:build/lib/libother_plugin.so

About

A collection of out-of-tree extensions for the Triton language and compiler

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages