Skip to main content

The Torch-MLIR Project

The Torch-MLIR project aims to provide first class compiler support from the PyTorch ecosystem to the MLIR ecosystem.

This project is participating in the LLVM Incubator process: as such, it is not part of any official LLVM release. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project is not yet endorsed as a component of LLVM.

PyTorch PyTorch is an open source machine learning framework that facilitates the seamless transition from research and prototyping to production-level deployment.

MLIR The MLIR project offers a novel approach for building extensible and reusable compiler architectures, which address the issue of software fragmentation, reduce the cost of developing domain-specific compilers, improve compilation for heterogeneous hardware, and promote compatibility between existing compilers.

Torch-MLIR Several vendors have adopted MLIR as the middle layer in their systems, enabling them to map frameworks such as PyTorch, JAX, and TensorFlow into MLIR and subsequently lower them to their target hardware. We have observed half a dozen custom lowerings from PyTorch to MLIR, making it easier for hardware vendors to focus on their unique value, rather than needing to implement yet another PyTorch frontend for MLIR. The ultimate aim is to be similar to the current hardware vendors adding LLVM target support, rather than each one implementing Clang or a C++ frontend.

pre-commit

All the roads from PyTorch to Torch MLIR Dialect

We have few paths to lower down to the Torch MLIR Dialect.

  • ONNX as the entry points.
  • Fx as the entry points

Project Communication

  • #torch-mlir channel on the LLVM Discord - this is the most active communication channel
  • Github issues here
  • torch-mlir section of LLVM Discourse

Install torch-mlir snapshot

At the time of writing, we release pre-built snapshots of torch-mlir for Python 3.11 and Python 3.10.

If you have supported Python version, the following commands initialize a virtual environment.

python3.11 -m venv mlir_venv
source mlir_venv/bin/activate

Or, if you want to switch over multiple versions of Python using conda, you can create a conda environment with Python 3.11.

conda create -n torch-mlir python=3.11
conda activate torch-mlir
python -m pip install --upgrade pip

Then, we can install torch-mlir with the corresponding torch and torchvision nightlies.

pip install --pre torch-mlir torchvision \
  --extra-index-url https://download.pytorch.org/whl/nightly/cpu \
  -f https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels

Using torch-mlir

Torch-MLIR is primarily a project that is integrated into compilers to bridge them to PyTorch and ONNX. If contemplating a new integration, it may be helpful to refer to existing downstreams:

While most of the project is exercised via testing paths, there are some ways that an end user can directly use the APIs without further integration:

FxImporter ResNet18

# Get the latest example if you haven't checked out the code
wget https://raw.githubusercontent.com/llvm/torch-mlir/main/projects/pt1/examples/fximporter_resnet18.py

# Run ResNet18 as a standalone script.
python projects/pt1/examples/fximporter_resnet18.py

# Output
load image from https://upload.wikimedia.org/wikipedia/commons/2/26/YellowLabradorLooking_new.jpg
...
PyTorch prediction
[('Labrador retriever', 70.65674591064453), ('golden retriever', 4.988346099853516), ('Saluki, gazelle hound', 4.477451324462891)]
torch-mlir prediction
[('Labrador retriever', 70.6567153930664), ('golden retriever', 4.988325119018555), ('Saluki, gazelle hound', 4.477458477020264)]

Repository Layout

The project follows the conventions of typical MLIR-based projects:

  • include/torch-mlir, lib structure for C++ MLIR compiler dialects/passes.
  • test for holding test code.
  • tools for torch-mlir-opt and such.
  • python top level directory for Python code

Developers

If you would like to develop and build torch-mlir from source please look at Development Notes

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (81.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (78.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

belfort_torch_mlir-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (81.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (78.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

belfort_torch_mlir-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (81.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (78.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

belfort_torch_mlir-2026.9.1-cp311-cp311-macosx_11_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4a9a4733e64743341a2db452ad89103c33784faf8ace63d2660d8b8c3e7fbc6c
MD5 6feb5b7ff4e61e0e1c27e0eda27d7a15
BLAKE2b-256 5659e15c361dd7a112f7cf4cbc99af1b8d04dfb293a9de883005aab4c2fa7c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a2b93c45d5822c43d804936c5cef1b2897401a9fabc852546c6042d2d4113be8
MD5 a52435ee16b9892370e7a51085461743
BLAKE2b-256 6618ab08c6bb4c0b9b1d1a042df944ba5979a2dc2a14d94e19c299c46767ee81

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b2d60123a872974be34df58454c8a3cae9b962fcdc2d071c1456da786bfc27b
MD5 c8edb179ede5e79d1a5b1f67a5d279ae
BLAKE2b-256 e3f4c47b37068f6f7700664c576f6680f374b77531917021a85c4d18c43e9878

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce9a14fb5a36ded19dbf94490533c481955d6e1a3512b88935e64b951ac44ebb
MD5 e500f8e8afd2afc4b755530d85a69b8a
BLAKE2b-256 f46d6ee39eac860695ba207d78087c01d7ece179cd761ca8c50be064b4c510a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b6980b585d27450acbcd84bf343a0cbf4bb08048144b0ed2db99315c64d44628
MD5 81e5524d833568d3be0bc538e0f38c2e
BLAKE2b-256 ef4bbb797d64d899abcaf37af199a3b114f072bc0396b120ddc2695d2f189826

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4be505ab80a602c35fd3ca0ccef2c2722636dde90375e13d364a555a25a9e3db
MD5 3a3fa2b6a0dd1d3e5dc82f292c374fa4
BLAKE2b-256 d2bed0d1e506f39323ab72d390424773e4db4a58003cf15946c63d0fc02162f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a0355a051b213438953ab6686949cbd95ba6101dba4fa7ec5d2d5d30bb1b451
MD5 32c83e5b7c2f10c89be29cd05a4e4de5
BLAKE2b-256 a2eb504ff22909da14d13b8e5f57a93ca09b15a0dc7448bd4d5e089bf02e8420

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 230e7c3b74e53bd52d729ff4ae1c0f550a473b2b2c6704f5628430cb2882e17f
MD5 58de1c96fe2e3fde5bd229750189fd9f
BLAKE2b-256 42a0665cb5c20f0b54ad2374a30c8402faae363c42c0e40046d20f4a8b897f1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_torch_mlir-2026.9.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfabca30837f274119eed917ff75ab6872a68ad7143020c2361047d4ea53af7f
MD5 4ff2a31a94434b629ecd4828074d0b66
BLAKE2b-256 9c47064f27e4518c46150b99fbfed2b42b07d1496e7908331948c0a8cbba0dcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.9.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on belfortlabs/torch-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2026.9.1 This release

9 files

2026.8.1

9 files

2026.7.1

9 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page