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

Metadata

Release files for torch-mlir 20261001

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for torch-mlir 20261001
File Actions
torch_mlir-20261001-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for torch_mlir-20261001-cp312-abi3-win_amd64.whl
torch_mlir-20261001-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torch_mlir-20261001-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261001-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for torch_mlir-20261001-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261001-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for torch_mlir-20261001-cp312-abi3-macosx_11_0_arm64.whl
torch_mlir-20261001-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for torch_mlir-20261001-cp311-cp311-win_amd64.whl
torch_mlir-20261001-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torch_mlir-20261001-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261001-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for torch_mlir-20261001-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261001-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for torch_mlir-20261001-cp311-cp311-macosx_11_0_arm64.whl
torch_mlir-20261001-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for torch_mlir-20261001-cp310-cp310-win_amd64.whl
torch_mlir-20261001-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for torch_mlir-20261001-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261001-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for torch_mlir-20261001-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261001-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for torch_mlir-20261001-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 880.5 MB

Release files / torch_mlir-20261001-cp312-abi3-win_amd64.whl

Download URL torch_mlir-20261001-cp312-abi3-win_amd64.whl
Size 82.6 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3a24686666641cdb9a2a967459bec9e040e68ef605c1f65421d755a88ed412b9
BLAKE2b-256 checksum
How to use checksums
f8a6f1c63eb25119515c17f79f0f216a0fde74f9bfc678a85c816a5984077e3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261001-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 80.4 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
e02ab29293ec2eba0a573ef20a154ecafd0ab1e8b305979fca2e2ac0b48e2b34
BLAKE2b-256 checksum
How to use checksums
0df80733cd4792f53f13bb6789cb7a77689c91a9f907ad1d9b4c7748d3ed24f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261001-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 77.3 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
60e950689052bcb2629c727350af445fd76afda1469ab32d00837b05670d834b
BLAKE2b-256 checksum
How to use checksums
c9f243d31fe02a9bea321d9cecf30a2f61a29a3063156fc79d3e91eef490374c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp312-abi3-macosx_11_0_arm64.whl

Download URL torch_mlir-20261001-cp312-abi3-macosx_11_0_arm64.whl
Size 53.2 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
16cc340633b96b77231836d09a955005063a4907b576b03c1681a8b1f3feb357
BLAKE2b-256 checksum
How to use checksums
3d0613c06ccd2e2dd2e9b8272cbec2cdf79d2e62b4259b339ea64d799d818d35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp311-cp311-win_amd64.whl

Download URL torch_mlir-20261001-cp311-cp311-win_amd64.whl
Size 82.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
553a0905aeae1b31ca62e36b8ba9ca8ddc5608903406a0bf7687697d55cea840
BLAKE2b-256 checksum
How to use checksums
2f2ef427068a72aae6b100d47a0409ce622a291d50f09896197b0ebe569413a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261001-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 80.4 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3fb6cc11d248f1ece7149cf21cc40f528b9c6f45424464678485db2c83c199af
BLAKE2b-256 checksum
How to use checksums
21425f964a3be788df2b0832dc95c399ccdf40a2b25ba31a4c39d9f0438ebe79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261001-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 77.3 MB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
ce024fba1d9ff527e9eef1e4ed2da9caec28bf69fafd7d22d82ac1a210fe1abe
BLAKE2b-256 checksum
How to use checksums
f684d343bcf6403dbdad943ad6468ef59112eb63afb9b0c74b2b7004a6310c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp311-cp311-macosx_11_0_arm64.whl

Download URL torch_mlir-20261001-cp311-cp311-macosx_11_0_arm64.whl
Size 53.2 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
51d0672a8c0a198d6bc27a9dafd917e11c04203197b736d1127396034d18ab2e
BLAKE2b-256 checksum
How to use checksums
3ff397f4c8bcb04500b41aad14d17f09d14b0c6deadf7271c0253eb75dc7776e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp310-cp310-win_amd64.whl

Download URL torch_mlir-20261001-cp310-cp310-win_amd64.whl
Size 82.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
9a24a73077aec9413f5a2918dece605110f3d94d87f7b3a4143f3618779b5199
BLAKE2b-256 checksum
How to use checksums
fe577b8efa4e654b11a64c7a2e5411e42c386ea44af66b719f435f808eed78f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261001-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 80.4 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4b2e6754e6854e9eec5d2a80c86e1d29cf4963800b9c021deb22d424ce6bf95a
BLAKE2b-256 checksum
How to use checksums
845611a0547087892020d40df8366f47580207259df7d8f4c96f3449b0efc727
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261001-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 77.3 MB
Tags CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c39f542d6483b7dc0ade2f666d1ecd6070de8c832dcbdb152220562b170a0d03
BLAKE2b-256 checksum
How to use checksums
9418fc8cdb0e1c0fb1e2034c47c34a668536296aab9f2f289d0a5804eeef31b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / torch_mlir-20261001-cp310-cp310-macosx_11_0_arm64.whl

Download URL torch_mlir-20261001-cp310-cp310-macosx_11_0_arm64.whl
Size 53.2 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e6d27a9bda1d82d215b6fb6da6d3507aebd50ffb0ebfd29e7d070d1dcf27b985
BLAKE2b-256 checksum
How to use checksums
823c21d43110d143a7d9c0090e459ec8bfb977b61956651beff0600377292446
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Security for torch-mlir 20261001

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for torch_mlir-20261001-cp312-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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