No module named 'triton.ops', cannot import name 'libdevice' or 'triton_key' from 'triton...': which Triton releases have it
Triton 3.2.0 (2025-01-22) removed triton.ops (matmul, flash_attention, blocksparse, matmul_perf_model); 3.1.0 is the last release with it. Most "No module named 'triton.ops'" errors come from bitsandbytes 0.45.0 and older, which import it as soon as Triton is installed; PyTorch 2.6.0 and later install Triton 3.2 or newer. Upgrade bitsandbytes to 0.45.1 or later. The other common ones: from triton.language.extra.cuda import libdevice needs Triton 3.0.0 or newer (PyTorch 2.4.0 or newer), and PyTorch 2.6 to 2.8 report "Cannot find a working triton installation" with Triton 3.5.0 or newer, because they look for triton_key, which 3.5.0 removed. Install the Triton your PyTorch pins (table below). For any other name, in any module of Triton, paste the error below.
Corrected on 2026-12-05: this page read only the first release of each minor version. Every release on PyPI was then read once (18 releases): no top-level name differs between a patch release and the first release of its minor, and only 1 module-and-name pair does (fence_async_shared in triton.tools.triton_to_gluon_translater.translator_helpers is not in 3.7.1). The lookup now gives it.
Examples:
Runs in your browser on triton.json (142 KB); nothing you paste is sent anywhere. Covers 48 top-level names and 5,531 module-and-name pairs in 187 modules.
Which Triton does each PyTorch release install?
Each PyTorch wheel on PyPI pins one Triton release on Linux; a different Triton next to it is where most of these errors start. From the Requires-Dist of each PyTorch release on PyPI:
| PyTorch | Triton |
|---|---|
| 2.0.0 | 2.0.0 |
| 2.2.0 | 2.2.0 |
| 2.3.0 | 2.3.0 |
| 2.4.0 | 3.0.0 |
| 2.5.0 | 3.1.0 |
| 2.6.0 | 3.2.0 |
| 2.7.0 | 3.3.0 |
| 2.8.0 | 3.4.0 |
| 2.9.0 | 3.5.0 |
| 2.10.0 | 3.6.0 |
| 2.11.0 | 3.6.0 |
| 2.12.0 | 3.7.0 |
| 2.13.0 | 3.7.1 |
| 2.14.0 | 3.8.x (~=3.8.0) |
| 2.15.0 | 3.9.x (~=3.9.0) |
PyTorch 2.1.0 lists no Triton requirement in its PyPI metadata and is left out. pip show triton and python -c "import torch; print(torch.__version__)" tell you which pair you have.
Which Triton modules disappeared, and in which release?
39 of the 187 modules that a Triton wheel has installed are gone from 3.9.0. Experimental Gluon modules for AMD gfx1250 are left out of this table but are in the lookup.
| Gone in | Date (PyPI) | Modules |
|---|---|---|
| 2.1.0 | 2023-09-01 | triton.impl, triton.impl.base, triton.language.extern, triton.language.libdevice, triton.tools.aot, triton.utils |
| 2.2.0 | 2024-01-10 | triton.interpreter, triton.interpreter.core, triton.interpreter.interpreter, triton.interpreter.memory_map, triton.interpreter.tl_lang, triton.interpreter.torch_wrapper |
| 2.3.0 | 2024-04-05 | triton.compiler.target |
| 3.0.0 | 2024-07-19 | triton.common, triton.common.backend, triton.common.build, triton.compiler.backends, triton.compiler.backends.cuda, triton.compiler.utils |
| 3.2.0 | 2025-01-22 | triton.ops, triton.ops.blocksparse, triton.ops.blocksparse.matmul, triton.ops.blocksparse.softmax, triton.ops.cross_entropy, triton.ops.flash_attention, triton.ops.matmul, triton.ops.matmul_perf_model |
| 3.4.0 | 2025-07-30 | triton.language._utils, triton.language.extra.cuda._experimental_tma, triton.tools.experimental_descriptor |
| 3.5.0 | 2025-10-13 | triton.profiler.hook |
| 3.8.0 | 2026-08-28 | triton.experimental.gluon.language.nvidia.blackwell.float2, triton.tools.triton_to_gluon_translater.translator, triton.tools.triton_to_gluon_translater.translator_helpers |
How do I read the error?
- The file in the traceback tells you whose import it is.
bitsandbytes/triton/...means bitsandbytes (upgrade it);torch/utils/_triton.pyortorch/_inductor/...means a PyTorch and Triton pair that do not match. - Windows: the
tritonpackage on PyPI has Linux wheels only. Community builds such astriton-windowshave their own version numbers; compare by the Triton version they report. - The NVIDIA parts (
triton.backends.nvidia,triton.language.extra.cuda) are copied into the wheel at build time fromthird_party/nvidia; in the repository they are not underpython/triton. Reading the repository alone misses them, which is why this page reads the wheels.
How was this read, and how was it checked?
From the Python files that pip install triton puts on disk: for the first release of each minor version, the triton/**/*.py of the Linux x86_64 wheel on PyPI were read (by HTTP range requests, without downloading the whole wheel) and parsed with Python's ast module. A module's names are everything it binds at module level and what from .x import * brings in; code under if TYPE_CHECKING: is skipped. Dates come from PyPI. The PyTorch pins and PyTorch's has_triton_package() were read from the PyTorch wheels and metadata on PyPI; the bitsandbytes imports from its release tags.
Checks: (1) each of the 48 top-level names is found as plain text in triton/__init__.py in every release of its range (424 name-and-release pairs) and not on either side (10 edges). (2) A regular expression finds 10,635 definitions in 689 file versions; all are among the names read. (3) Against a different source, the triton git tags, 12 release checks agree:
| Name or module | Release | Git and data |
|---|---|---|
triton.ops.matmul | 3.1.0 | has it |
triton.ops.matmul | 3.2.0 | does not |
triton.language.libdevice | 2.0.0 | has it |
triton.language.libdevice | 2.1.0 | does not |
triton.language.extra.cuda.libdevice | 3.0.0 | has it |
triton.language.extra.cuda.libdevice | 2.3.0 | does not |
triton.compiler.compiler.triton_key | 3.4.0 | has it |
triton.compiler.compiler.triton_key | 3.5.0 | does not |
triton.runtime.autotuner.PTXASError | 3.3.0 | has it |
triton.runtime.autotuner.PTXASError | 3.2.0 | does not |
triton.language.make_tensor_descriptor | 3.4.0 | has it |
triton.language.make_tensor_descriptor | 3.3.0 | does not |
Limits
- Nothing was installed or run. "Has it" means the import statement resolves in the Python files; Triton's compiled extension (
triton._C) is not read. - The ranges use the first release of each minor version (and the newest). Every release was also read once (18 releases, from the same kind of wheel, with the same rules): one module-and-name pair differs in a patch release, and the lookup prints it under the range.
- Only the Linux x86_64 wheel (CPython 3.12, or 3.11 for older releases) was read. Other wheels of the same release should carry the same Python files.
Questions
How do I fix "No module named 'triton.ops'"?
Triton 3.2.0 (2025-01-22) removed triton.ops; 3.1.0 is the last release with it. The import is usually in bitsandbytes: 0.45.0 and older import triton.ops.matmul_perf_model when Triton is installed, so import bitsandbytes fails on PyTorch 2.6 and later, which install Triton 3.2 or newer. Upgrade bitsandbytes to 0.45.1 or later. Pinning Triton below 3.2 would break PyTorch's own pin.
How do I fix "cannot import name 'libdevice' from 'triton.language.extra.cuda'"?
That path exists from Triton 3.0.0 (2024-07-19). The installed Triton is 2.x, usually because PyTorch is older than 2.4 (PyTorch 2.4.0 pins Triton 3.0.0). Upgrade PyTorch, which brings the matching Triton. In Triton 2.1 to 2.3 the same functions are in triton.language.math.
Why does PyTorch say "Cannot find a working triton installation" when Triton is installed?
PyTorch 2.6 to 2.8 check for Triton by importing triton_key from triton.compiler.compiler, which Triton 3.5.0 (2025-10-13) removed. With Triton 3.5 or newer next to PyTorch 2.8 or older, torch.compile thinks Triton is missing. Install the Triton that your PyTorch pins, or upgrade PyTorch (2.9.0 only imports triton).
Which Triton does my PyTorch need?
Each PyTorch wheel on PyPI pins one Triton release on Linux: 2.4.0 needs 3.0.0, 2.6.0 needs 3.2.0, 2.9.0 needs 3.5.0, and so on. The table on this page lists them from the PyPI metadata.
Does this page cover the backends and experimental modules too?
Yes: every module that the Triton wheel installs, 2.0.0 to 3.9.0, 5,531 module-and-name pairs in 187 modules, including triton.backends and triton.language.extra, which are copied in at build time and are not under python/triton in the repository.
Sources
- The triton wheels on PyPI, 2.0.0 to 3.9.0 (file names and sha256 in the build notes); triton-lang/triton release tags for the checks, for example python/triton/ops at v3.1.0 and compiler.py at v3.4.0.
- PyTorch: the
Requires-Distof each release on PyPI;torch/utils/_triton.pyin the 2.6.0 to 2.9.0 wheels. - bitsandbytes: bitsandbytes/triton/int8_matmul_mixed_dequantize.py at 0.45.0 (imports
triton.ops.matmul_perf_model) and at 0.45.1 (its own copy).
The same data as JSON: triton.json, licensed CC BY 4.0.
Related: "ptxas fatal: Value 'sm_121a' is not defined" (which Triton and PyTorch support a GPU) · which PyTorch and CUDA each vLLM release needs · "cannot import name ... from 'vllm'".