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.8.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.8.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.8.1-cp313-cp313-macosx_11_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

belfort_torch_mlir-2026.8.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.8.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.8.1-cp312-cp312-macosx_11_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

belfort_torch_mlir-2026.8.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.8.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.8.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.8.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5adb44429016cf196f1e6b6c07a664a6b7154723d821dc907b93a0aa65c208ac
MD5 daa725ce71617717c12b724ee0cd8eab
BLAKE2b-256 0650072ba4f3aa95970e070ea86e303ca87677028ac284e948c070902bb8dcb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54887a9ad30a67bba7941939bc3194f9cd18367e78f7777acf52ca596002d7e4
MD5 e45d0edae0b8cc603ae29682f58d7810
BLAKE2b-256 c309e8d3a7dee3cf04447feff1e2f50cf15f40441b1c11df20bc280a1bf0c91f

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1cf46b51eb5b9646fbf238f6eeac3d09a20628a60749e3fa105f951706477738
MD5 9d15bce94781a38acef921310e964d0f
BLAKE2b-256 f0f14646050c48a9c676b68656f0345d104575781000601de095519d96b27dbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e37d70fefe3902e4d7bce5d4eaf784e3c9ca6784d3fee5d6b397f540f8011112
MD5 4d59627cec2ee4a173c628091dca6f3b
BLAKE2b-256 903d92db7ae2c3e8c8186187ff8cfe58842e653f00c170136343909d650f9bd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b97a22310a369564c50d439606965b693ab0cd9a13e0909dad19a0c3e5986294
MD5 468788ee7e3156eec1f1d1491dbb52ca
BLAKE2b-256 2dbd1f1523e987088ecad804491ffc1e4899f95a37d7187e90c5e821624d2eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9705f5e8d38eba962b7283dc5b0a86f10e44049a8d31b68177ae739545926aa4
MD5 ac7e24e77a33d3b3c28fcf96d64f4a66
BLAKE2b-256 57c4f1899fddcd87abe04522515a70dd92c4fd3ea2265c7b6ec52ef9cacd2999

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64dce907edc35782f9739f051950f0e663c7806c6cd82d3b93d2e853a3e10b19
MD5 9e857dd730ce8d0a3f2ec457217b3ba0
BLAKE2b-256 2fe6c1a855b60c42d704583811e4f8f1d02dd6158ccbffc73b888063cfe1a811

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f882c97fe4d78883b14667ec6d0f5b408cd1d804de7094b1f89214e4601e32d4
MD5 a772e8e60504a828dd429759e83cb72d
BLAKE2b-256 de749815621f4cb8192f1fa88bed20d10836a93eacf4bbd3cf230732f5f36542

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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.8.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_torch_mlir-2026.8.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbd85df721b9bd46feb2759ad21ab18f4d6d8dfa0de4c77dbffa531626b34a98
MD5 7bb1fab0e48800de4718aaf04de456e7
BLAKE2b-256 8d1ab0c9be5eb7111d5af3cd064ef97a65011c61e9fc313d2604d24418ecb3c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_torch_mlir-2026.8.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

2026.9.1

9 files

This release

2026.8.1 This release

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