{"id":13438166,"url":"https://github.com/triton-lang/triton","last_synced_at":"2026-01-22T01:01:59.001Z","repository":{"id":20224756,"uuid":"23496542","full_name":"triton-lang/triton","owner":"triton-lang","description":"Development repository for the Triton language and compiler","archived":false,"fork":false,"pushed_at":"2024-08-23T05:36:16.000Z","size":341506,"stargazers_count":12308,"open_issues_count":651,"forks_count":1487,"subscribers_count":184,"default_branch":"main","last_synced_at":"2024-08-23T09:51:02.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://triton-lang.org/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/triton-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-30T17:07:16.000Z","updated_at":"2024-08-24T13:37:34.927Z","dependencies_parsed_at":"2023-09-28T09:04:34.729Z","dependency_job_id":"aa2e6034-4179-4df0-b3a9-05932f0609ac","html_url":"https://github.com/triton-lang/triton","commit_stats":{"total_commits":2415,"total_committers":330,"mean_commits":7.318181818181818,"dds":0.7971014492753623,"last_synced_commit":"4fd733d9fdfee58cc136d1b9d55aceeb6f05b6a3"},"previous_names":["triton-lang/triton","openai/triton"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triton-lang%2Ftriton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triton-lang%2Ftriton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triton-lang%2Ftriton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triton-lang%2Ftriton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triton-lang","download_url":"https://codeload.github.com/triton-lang/triton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221729815,"owners_count":16871112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:03.367Z","updated_at":"2026-01-22T01:01:58.992Z","avatar_url":"https://github.com/triton-lang.png","language":"C++","funding_links":[],"categories":["MLIR","C++","Computation and Communication Optimisation","Repos","Learning Resources","1. Core Frameworks \u0026 Libraries","Open Source Git Repositories","ML Performance"],"sub_categories":["AI Compilation Frameworks","Frameworks"],"readme":"\n| **`Documentation`** | **`Nightly Wheels`** |\n|-------------------- | -------------------- |\n| [![Documentation](https://github.com/triton-lang/triton/actions/workflows/documentation.yml/badge.svg)](https://triton-lang.org/) | [![Wheels](https://github.com/triton-lang/triton/actions/workflows/wheels.yml/badge.svg)](https://github.com/triton-lang/triton/actions/workflows/wheels.yml) |\n\n# Triton Conference 2025\n\n![Triton Banner](https://github.com/user-attachments/assets/b4b6972a-857c-417f-bf2c-f16f38a358c0)\n\nThe 3rd Triton Developer Conference took place on October 21, 2025 at the Microsoft Silicon Valley Campus in Mountain View, California.\n\n### Conference Materials\n\nConference recordings and materials are now available online:\n\n- **Conference Videos:** [YouTube Playlist](https://www.youtube.com/playlist?list=PLc_vA1r0qoiQqCdWFDUDqI90oY5EjfGuO)\n- **Conference Slides:** [Google Drive Folder](https://drive.google.com/drive/folders/1KB6tD3UM1J0_eUp-F-JSlGrargLBawIr)\n\nFor previous conference materials, see:\n- [2024 Conference Materials](docs/meetups/dev_conference_2024.md)\n- [2023 Conference Materials](docs/meetups/dev-meetup-2023.md)\n\n# Triton\n\nThis is the development repository of Triton, a language and compiler for writing highly efficient custom Deep-Learning primitives. The aim of Triton is to provide an open-source environment to write fast code at higher productivity than CUDA, but also with higher flexibility than other existing DSLs.\n\nThe foundations of this project are described in the following MAPL2019 publication: [Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations](http://www.eecs.harvard.edu/~htk/publication/2019-mapl-tillet-kung-cox.pdf). Please consider citing this work if you use Triton!\n\nThe [official documentation](https://triton-lang.org) contains installation instructions and tutorials.  See also these third-party [Triton puzzles](https://github.com/srush/Triton-Puzzles), which can all be run using the Triton interpreter -- no GPU required.\n\n# Quick Installation\n\nYou can install the latest stable release of Triton from pip:\n\n```shell\npip install triton\n```\n\nBinary wheels are available for CPython 3.10-3.14.\n\n# Install from source\n\n```shell\ngit clone https://github.com/triton-lang/triton.git\ncd triton\n\npip install -r python/requirements.txt # build-time dependencies\npip install -e .\n```\n\nOr with a virtualenv:\n\n```shell\ngit clone https://github.com/triton-lang/triton.git\ncd triton\n\npython -m venv .venv --prompt triton\nsource .venv/bin/activate\n\npip install -r python/requirements.txt # build-time dependencies\npip install -e .\n```\n\n# Building with a custom LLVM\n\nTriton uses LLVM to generate code for GPUs and CPUs.  Normally, the Triton build\ndownloads a prebuilt LLVM, but you can also build and use LLVM from source.\n\nLLVM does not have a stable API, so the Triton build will not work at an\narbitrary LLVM version.\n\nFor convenience, use the following command to build LLVM and install Triton with the custom LLVM:\n\n```shell\nmake dev-install-llvm\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\nAlternatively, follow these steps to build LLVM from source manually.\n\u003c/summary\u003e\n\n1. Find the version of LLVM that Triton builds against.  Check\n`cmake/llvm-hash.txt` to see the current version. For example, if it says:\n       49af6502c6dcb4a7f7520178bd14df396f78240c.\n\n   This means that the version of Triton you have builds against\n   [LLVM](https://github.com/llvm/llvm-project) 49af6502.\n\n2. `git checkout` LLVM at this revision.  Optionally, make additional\n   modifications to LLVM.\n\n3. [Build LLVM](https://llvm.org/docs/CMake.html).  For example, you might run:\n\n       $ cd $HOME/llvm-project  # your clone of LLVM.\n       $ mkdir build\n       $ cd build\n       $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON ../llvm -DLLVM_ENABLE_PROJECTS=\"mlir;llvm;lld\" -DLLVM_TARGETS_TO_BUILD=\"host;NVPTX;AMDGPU\"\n       $ ninja\n\n4. Grab a snack, this will take a while.\n\n5. Build Triton as above, but set the following environment variables:\n\n       # Modify as appropriate to point to your LLVM build.\n       $ export LLVM_BUILD_DIR=$HOME/llvm-project/build\n\n       $ cd \u003ctriton install\u003e\n       $ LLVM_INCLUDE_DIRS=$LLVM_BUILD_DIR/include \\\n         LLVM_LIBRARY_DIR=$LLVM_BUILD_DIR/lib \\\n         LLVM_SYSPATH=$LLVM_BUILD_DIR \\\n         pip install -e .\n\n\u003c/details\u003e\n\n# Tips for building\n\n- Set `TRITON_BUILD_WITH_CLANG_LLD=true` as an environment variable to use clang\n  and lld.  lld in particular results in faster builds.\n\n- Set `TRITON_BUILD_WITH_CCACHE=true` to build with ccache.\n\n- Set `TRITON_HOME=/some/path` to change the location of the `.triton`\n  directory where Triton's cache is located and downloads are stored\n  during the build. By default, this is the user's home directory. It\n  can be changed anytime.\n\n- If you're running out of memory when building Triton, specify the `MAX_JOBS`\n  environment variable (to the `pip install -e .` command) to limit the\n  number of jobs.\n\n- Pass `--no-build-isolation` to `pip install` to make nop builds faster.\n  Without this, every invocation of `pip install` uses a different symlink to\n  cmake, and this forces ninja to rebuild most of the `.a` files.\n\n- The build system creates a `compile_commands.json` file under the Triton repo\n  directory. This file is used by VSCode IntelliSense and clangd to provide\n  code completion and other features for C++ code.\n\n  If IntelliSense does not work, you can try the following steps:\n\n    - Do a local build. Run command `pip install -e .`.\n    - Get the full path to the `compile_commands.json` file produced by the build:\n      `find ./build -name 'compile_commands.json' | xargs readlink -f`.\n      You might get a full path similar to `/Users/{username}/triton/build/cmake.macosx-11.1-arm64-cpython-3.12/compile_commands.json`.\n    - In VSCode, install the\n      [C/C++\n      extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools),\n      then open the command palette (`Shift + Command + P` on Mac, or `Shift +\n      Ctrl + P` on Windows/Linux) and open `C/C++: Edit Configurations (UI)`.\n    - Open \"Advanced Settings\" and paste the full path to\n      `compile_commands.json` into the \"Compile Commands\" textbox.\n\n# Running tests\n\nThere currently isn't a turnkey way to run all the Triton tests, but you can\nfollow the following recipe:\n\n```shell\n# One-time setup.  Note this will reinstall local Triton because torch\n# overwrites it with the public version.\n$ make dev-install\n\n# To run all tests (requires a GPU)\n$ make test\n\n# Or, to run tests without a gpu\n$ make test-nogpu\n```\n\n# Tips for hacking\n\nFor detailed instructions on how to debug Triton's frontend, please refer to this [tutorial](https://triton-lang.org/main/programming-guide/chapter-3/debugging.html). The following includes additional tips for hacking on Triton's backend.\n\n**Configuration knobs**\n\nSee [`python/triton/knobs.py`](python/triton/knobs.py) for the full list of configuration knobs. You can set those knobs directly in python or use environment variables to control them. Below are some of the environment variables you can specify (see `knobs.py` for the full list):\n\n- `MLIR_ENABLE_DUMP=1` dumps the IR before every MLIR pass Triton runs, for all\n   kernels. Use `MLIR_ENABLE_DUMP=kernelName` to dump for a specific kernel only.\n  - Triton cache can interfere with the dump. In cases where `MLIR_ENABLE_DUMP=1` does not work, try cleaning your triton cache: `rm -r ~/.triton/cache/*`.\n- `MLIR_DUMP_PATH` specifies where `MLIR_ENABLE_DUMP` will dump to. If unset will dump to stderr.\n- `LLVM_IR_ENABLE_DUMP=1` dumps the IR before every pass run over the LLVM IR.\n- `TRITON_REPRODUCER_PATH=\u003creproducer_path\u003e` will generate an MLIR reproducer file\n  at `\u003creproducer_path\u003e` before each MLIR compiler stage. If any of the stages fail,\n  `\u003creproducer_path\u003e` will be a local MLIR reproducer captured right before the failing pass.\n- `TRITON_INTERPRET=1` uses the Triton interpreter instead of running on the\n  GPU.  You can insert Python breakpoints in your kernel code!\n- `TRITON_ENABLE_LLVM_DEBUG=1` passes `-debug` to LLVM, printing a lot of\n  debugging information to stdout.  If this is too noisy, run with just\n  `TRITON_LLVM_DEBUG_ONLY` instead to limit the output.\n  - An alternative way to reduce output noisiness is running with\n  `LLVM_IR_ENABLE_DUMP=1`, extract the IR before the LLVM pass of interest, and\n  then run LLVM's `opt` standalone, perhaps passing `-debug-only=foo` on the\n  command line.\n\n- `TRITON_LLVM_DEBUG_ONLY=\u003ccomma-separated\u003e` is the equivalent of LLVM's\n  `-debug-only` command-line option. This limits the LLVM debug output to\n  specific pass or component names (which are specified using `#define\n  DEBUG_TYPE` throughout LLVM and Triton) in order to allow the debug output to\n  be less noisy. `TRITON_LLVM_DEBUG_ONLY` allows for one or more comma\n  separated values to be specified (eg\n  `TRITON_LLVM_DEBUG_ONLY=\"tritongpu-remove-layout-conversions\"` or\n  `TRITON_LLVM_DEBUG_ONLY=\"tritongpu-remove-layout-conversions,regalloc\"`).\n- `TRITON_ENABLE_ASAN=1` invokes the LLVM address sanitizer for\n  memory leak and out of bounds access detection. Currently only supported on the AMD\n  backend. This must be run using the ASAN libraries documented [here](https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/using-gpu-sanitizer.html).\n  - When enabling the address sanitizer it is recommended to disable various memory caching strategies\n  both within the ROCm stack and PyTorch. This will give the address sanitizer the best chance at finding the\n  memory fault where it originates. See this [test](https://github.com/triton-lang/triton/blob/main/third_party/amd/python/test/test_address_sanitizer.py) for more details.\n\n- `USE_IR_LOC={ttir,ttgir}` reparses the IR such that the location information\n  will be the line number of the IR file with that particular extension,\n  instead of line number of the python file. This can provide a direct mapping\n  from the IR to llir/ptx. When used with performance tools, it can provide a\n  breakdown on IR instructions.\n- `TRITON_PRINT_AUTOTUNING=1` prints out the best autotuning config and total time\n  spent for each kernel after autotuning is complete.\n- `DISABLE_LLVM_OPT` will disable llvm optimizations for make_llir and make_ptx\n  if its value is true when parsing as Bool. Otherwise, it will be parsed as a list\n  of flags to disable llvm optimizations. One usage case is\n  `DISABLE_LLVM_OPT=\"disable-lsr\"`\n  Loop strength reduction is known to cause up to 10% performance changes for\n  certain kernels with register pressure.\n- `TRITON_ALWAYS_COMPILE=1` forces to compile kernels regardless of cache hit.\n- `MLIR_ENABLE_TIMING` dumps the timing information for each MLIR pass.\n- `LLVM_ENABLE_TIMING` dumps the timing information for each LLVM pass.\n- `TRITON_DEFAULT_FP_FUSION` overrides the default behavior of allowing fp fusion (mul+add-\u003efma).\n- `MLIR_ENABLE_DIAGNOSTICS=\u003ccomma-separated\u003e` controls diagnostic emission in MLIR.\n  Options are: `warnings`, `remarks`, `stacktraces`, `operations`.\n  Use comma-separated values to customize output. For example,\n  `MLIR_ENABLE_DIAGNOSTICS=remarks,operations` enables remarks and IR operations,\n  while `MLIR_ENABLE_DIAGNOSTICS=warnings,stacktraces` enables warnings with\n  stacktraces. By default, only errors are shown. Setting `warnings` includes\n  errors and warnings; `remarks` includes errors, warnings, and remarks.\n- `MLIR_ENABLE_REMARK` is deprecated. Please use `MLIR_ENABLE_DIAGNOSTICS=remarks`.\n- `TRITON_KERNEL_DUMP` enables the dumping of the IR from each compilation stage and the final ptx/amdgcn.\n- `TRITON_DUMP_DIR` specifies the directory to save the dumped IR and ptx/amdgcn when `TRITON_KERNEL_DUMP` is set to 1.\n- `TRITON_KERNEL_OVERRIDE` enables the override of the compiled kernel with a user-specified IR/ptx/amdgcn at the beginning of each compilation stage.\n- `TRITON_OVERRIDE_DIR` specifies the directory from which to load the IR/ptx/amdgcn files when `TRITON_KERNEL_OVERRIDE` is set to 1.\n- `TRITON_F32_DEFAULT` sets the default input precision of `tl.dot` when using 32-bit floats, which can be either `ieee`, `tf32`, or `tf32x3`.\n- `TRITON_FRONT_END_DEBUGGING=1` disables exception wrapping when an error occurs in the compiler frontend, allowing the full stack trace to be seen.\n- `TRITON_DISABLE_LINE_INFO=1` removes all line information from the module.\n- `PTXAS_OPTIONS` passes additional command-line options to the PTX assembler `ptxas` (only on NVIDIA).\n- `LLVM_EXTRACT_DI_LOCAL_VARIABLES` emit full debug info, allowing for eval of values in gpu debuggers (ie cuda-gdb, rocm-gdb etc)\n- `TRITON_DEFAULT_BACKEND=\u003cbackend\u003e` optionally sets the default backend used by Triton when\n  constructing the active driver (i.e., `triton.runtime.driver.active`).\n\n\u003e [!NOTE]\n\u003e Some of these environment variables don't have a knob in `knobs.py`-- those are only relevant to the C++ layer(s), hence they don't exist in the python layer.\n\n**Kernel Override Steps**\n\n```bash\nexport TRITON_ALWAYS_COMPILE=1\nexport TRITON_KERNEL_DUMP=1\nexport TRITON_DUMP_DIR=\u003cdump_dir\u003e\nexport TRITON_KERNEL_OVERRIDE=1\nexport TRITON_OVERRIDE_DIR=\u003coverride_dir\u003e\n# Step 1: Run the kernel once to dump kernel's IRs and ptx/amdgcn in $TRITON_DUMP_DIR\n# Step 2: Copy $TRITON_DUMP_DIR/\u003ckernel_hash\u003e to $TRITON_OVERRIDE_DIR\n# Step 3: Delete the stages that you do not want to override and modify the stage you do want to override\n# Step 4: Run the kernel again to see the overridden result\n```\n\n**Compiler Pipeline Inspection Steps**\nTo introspect the pipeline `add_stages`, before running your kernels, simply set\nthe add_stages_inspection_hook like so:\n\n```python\ndef inspect_stages(_self, stages, options, language, capability):\n    # inspect or modify add_stages here\ntriton.knobs.runtime.add_stages_inspection_hook = inspect_stages\n```\nExamples of how to use this for out of tree plugin passes is [here](lib/Plugins/README.md)\n# Changelog\n\nVersion 2.0 is out! New features include:\n\n- Many, many bug fixes\n- Performance improvements\n- Backend rewritten to use MLIR\n- Support for kernels that contain back-to-back matmuls (e.g., flash attention)\n\n# Contributing\n\nCommunity contributions are more than welcome, whether it be to fix bugs or to add new features at [github](https://github.com/triton-lang/triton/). For more detailed instructions, please visit our [contributor's guide](CONTRIBUTING.md).\n\n# Compatibility\n\nSupported Platforms:\n\n- Linux\n\nSupported Hardware:\n\n- NVIDIA GPUs (Compute Capability 8.0+)\n- AMD GPUs (ROCm 6.2+)\n- Under development: CPUs\n\n# Development Container (Dev Container)\n\n**Dev Containers** for the Triton project are available from\nthe [triton-dev-containers repository](https://github.com/redhat-et/triton-dev-containers).\n\n### Key Benefits:\n- **Consistency**: All developers can work with the same development\n  environment, ensuring uniform behavior across different systems.\n- **Isolation**: The container prevents potential conflicts with software\n  installed on your local machine.\n- **Portability**: Easily share the development environment with team members,\n  minimizing onboarding time and setup issues.\n\n### How to Use the Dev Container:\n\nFor detailed instructions on how to use the dev containers, please see\nthe [dev container user guide](https://github.com/redhat-et/triton-dev-containers/blob/main/.devcontainer/devcontainer.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriton-lang%2Ftriton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriton-lang%2Ftriton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriton-lang%2Ftriton/lists"}