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.1

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

Total release size: 643.6 MB

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

Download URL belfort_torch_mlir-2026.10.1-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
3ec8813f13cc67ad8bba5650f16d6ea7764a9bf279e4a6d2a4047821cd4a9c34
BLAKE2b-256 checksum
How to use checksums
460fc9a9b7871793b200f0353f21e56f254cbf9249a81e33b17b13fe720df268
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 / belfort_torch_mlir-2026.10.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.1-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
656f599a8dcb092636ab81e8ca7a4e138d8634fb09bc5cc110c8b898607a8f5d
BLAKE2b-256 checksum
How to use checksums
78bde92ba9a871fde275375900bd144ec64aca5610259fd1d5587b74fdaa9076
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 / belfort_torch_mlir-2026.10.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.1-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
1a72c040e0ccf1e594975cf41077c05c1281eaaf08bcd26d90f42ac816956f37
BLAKE2b-256 checksum
How to use checksums
e928691bd5d13a048629b68aa90ecf7b31e7cedf69a7ae15cae5cc35eb3f3e24
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 / belfort_torch_mlir-2026.10.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.1-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
cf56eb44b4e36c0d3d18467925e062f9106eac01c06a401c5788ed406962b3bd
BLAKE2b-256 checksum
How to use checksums
34f9ed7de10469300a0ed55e2f8df99ec42420a35d78b6801e22d7fcc76b7166
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 / belfort_torch_mlir-2026.10.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.1-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
4dc08304cd80aae799a3c66f1255ab98d6ed8af9b10194589f8f586ade6c5603
BLAKE2b-256 checksum
How to use checksums
245a3cf68dc0d5515607e7b6c09fa987e21e5748b4f02a38bf55c328e07d252f
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 / belfort_torch_mlir-2026.10.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.1-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
d24fef8748783b09c6862db07939257589979a376f9c4b059bed0905c45440cf
BLAKE2b-256 checksum
How to use checksums
3330a0dd24aaf53e39168c851452cc33fa6a6c658c7705f435fe93a04c8736ab
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 / belfort_torch_mlir-2026.10.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL belfort_torch_mlir-2026.10.1-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
a2ad727f9b9900d6547d0902caaa40a373ca602b228b31718a8ba7d3bf72a67b
BLAKE2b-256 checksum
How to use checksums
5ba3fe1f94affef9566032044927b213ac4888f7656e713e56661d9e7499f22b
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 / belfort_torch_mlir-2026.10.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL belfort_torch_mlir-2026.10.1-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
79ffcb0ca0760ebc526f0ae13b991509fc24962a30c0568208295e3e404d1e7f
BLAKE2b-256 checksum
How to use checksums
b661523ba0000de7c79fdbe3e0b5803c05d80137f797d35e1245b9d3b9c1e285
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 / belfort_torch_mlir-2026.10.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL belfort_torch_mlir-2026.10.1-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
181592a4f91e4dfaf25b57f166d6b36c006dd0e0e5fd3ee9c659ed5ac13b67e0
BLAKE2b-256 checksum
How to use checksums
0d39e6653459a25fb1fd349e7c952e0feaeeeb203ca9f6958ad47f29780c4f66
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 belfort-torch-mlir 2026.10.1

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 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for belfort_torch_mlir-2026.10.1-cp313-cp313-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 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