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 belfort-torch-mlir 2026.10.9

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 belfort-torch-mlir 2026.10.9
File Actions
belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
belfort_torch_mlir-2026.10.9-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp314-cp314-macosx_11_0_arm64.whl
belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
belfort_torch_mlir-2026.10.9-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp313-cp313-macosx_11_0_arm64.whl
belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
belfort_torch_mlir-2026.10.9-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp312-cp312-macosx_11_0_arm64.whl
belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
belfort_torch_mlir-2026.10.9-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for belfort_torch_mlir-2026.10.9-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 858.1 MB

Release files / belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 81.4 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0ae98d5dbb057839ce1a881106ff99e2657ef6c3135657fb86976d8805770762
BLAKE2b-256 checksum
How to use checksums
7400fc1078e4776ee309bf6e78dcb42b856c4e878626cad581c36f06ca195883
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 78.6 MB
Tags CPython 3.14 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
4553c80af1fdbecae79fb8ae464d8bbf7a1991800848cfe4bd1d7c888e9316ec
BLAKE2b-256 checksum
How to use checksums
3570dcda0ea1c2fdfc11a5f8d6872c76da995e5c0ec0823c37c81bc23ef24a9e
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp314-cp314-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.9-cp314-cp314-macosx_11_0_arm64.whl
Size 54.5 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0c47e1613754bb3f52716f75250e9ffa7c3ec537e98a91098cd434dac241d584
BLAKE2b-256 checksum
How to use checksums
7a0a0f49befde6478f5b068bd553f89603b60d490bcc62eb228fca450b2f592a
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 81.4 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c007aaf2f43bb8b643c0250796b47d7de629214a1824c5f53c05bd8faa164842
BLAKE2b-256 checksum
How to use checksums
b8e5780cb29112bffde12e1ac8c264e2712a22db0f81d12840bd519ee3de3933
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.9-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 78.6 MB
Tags CPython 3.13 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
301c6edccb9fa284c3772ede9706a3c604d017f901b6e7fa3d871437f2262b04
BLAKE2b-256 checksum
How to use checksums
06ac06b08a8e85f3ac3d158111a3b38f24fd5b791c08d23995cff7d3cd1db267
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp313-cp313-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.9-cp313-cp313-macosx_11_0_arm64.whl
Size 54.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b0f3ef964b622a2544e16b0fddf7f6c5dde613fabb42f5e2f9b26b4fa9e345c7
BLAKE2b-256 checksum
How to use checksums
4174e7638a1b6558fceb09a1630473cd4c8fbca41efdd2abd477e1ecbebf595a
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 81.4 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1a95eaa6f821bbe505d9d282848ba8d8c51f02dcf69d619fd24fce85cc5d559b
BLAKE2b-256 checksum
How to use checksums
9bb1935b6abd32b25bcc0f789a0f0bd675a0d886b379951f57fc25ddf935bfed
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.9-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 78.6 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9858772b074ae64668237b9c2dacf1d5d9c56f43374bb4da54a970e6a44665af
BLAKE2b-256 checksum
How to use checksums
aeead53ea7c312ecf238167e01a22cecca8b5a54215ffe9511eeae62e9f13bf5
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp312-cp312-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.9-cp312-cp312-macosx_11_0_arm64.whl
Size 54.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c40e2bfb23b4b0dfd066197c2a6b33442df6bb9be343a8df3092affec5da4324
BLAKE2b-256 checksum
How to use checksums
480247a375cba677e8dc09ba27b97b1c642c48d3164037721e9889f79bafb211
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 81.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
589d347754c3c036e7437fdf0936af04f3558d2f927e94f39de44df76c586d65
BLAKE2b-256 checksum
How to use checksums
f13091d50b4a9cddcd2a977445fcdd26f23cb71cdc4af2117ee7a12dacf9fa1f
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.9-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 78.6 MB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c98b577174286bf2e9d8734efda235718871fb57fd192072be6101c5a058643a
BLAKE2b-256 checksum
How to use checksums
687fdfae5398323fad8c8ccd6276888b89b7b6f1fc4ad508ce66a38e14f3eb5f
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 9, 2026.

Transparency log

Release files / belfort_torch_mlir-2026.10.9-cp311-cp311-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.9-cp311-cp311-macosx_11_0_arm64.whl
Size 54.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a742a59f5ef84957d10587195dbc7c0632660120d62325984aee15e271dc3dea
BLAKE2b-256 checksum
How to use checksums
7f87b0c07ab432fcbb5ba1cded64feb46c84f447fd02ddb2dd356e18427c7ce3
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 9, 2026.

Transparency log

Security for belfort-torch-mlir 2026.10.9

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 belfort_torch_mlir-2026.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.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 9, 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