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

Total release size: 858.1 MB

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

Download URL belfort_torch_mlir-2026.11.1-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
432d25f513bc4c06a447043efd332261cea56d28be53f2790e3b4b0cf611a981
BLAKE2b-256 checksum
How to use checksums
d1f72015b453099fcbccb63268b59373969537535832d8b0d3160a714a5f8534
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.1-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
fc380cfbf2462da185eabc236775724ac01b02d8d3479895fd9cb4fab75d8b29
BLAKE2b-256 checksum
How to use checksums
7531db866e81ce86f10f1268e587abedbf7401cdc37bd9c5e6ab4dea8b13a6cb
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.1-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
f4762870461588ae1fc827d590772c5a721499ecc9143df20acefbdff54b7932
BLAKE2b-256 checksum
How to use checksums
cc0cb3b23f74c20c9eea769df0fe81c292cd732201e9966ca0fa76fce0cf6883
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
5f2e490e8fd2e1330c5104bda7211cf2d8a2fc80b2ee28b054fb9abb4d1f2ac2
BLAKE2b-256 checksum
How to use checksums
d89e49231afc06a60e4c42f9bbb4e68b99841ede745d14736a50f004aa9a637c
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
f49b2d836c3aaee8b77b177767dbbcda54e546bd8d55ddb77ee3cf59096dd64c
BLAKE2b-256 checksum
How to use checksums
a8ec1f7ccc3ef8f0962a5cedb2ed28dff3eba336d9e618bc3ca9ee9c8c02f44f
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
b37293236847ce18c6d9c871d78f7060db9880b09bdb9d69cf724151bf8a938e
BLAKE2b-256 checksum
How to use checksums
aa5a9c90a49da6e0d2542c96ffe341f031aeeb88fb8e79402a5d6f956dcf27ac
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
4538feaf8dc124095bd1818921587a1de76334fccf4fd142fb220c173f096ff2
BLAKE2b-256 checksum
How to use checksums
0100aa6e8e0344842a8da91a3a495f07d6cc9f9f521d7a48f5e1566784c976de
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
10e09e5534d6381337b74619e33f2858b79214ca78031885f9bb06a916055b6b
BLAKE2b-256 checksum
How to use checksums
9fa0b9f4a1a0c9d7ede3899db2eb4695518fe52466875d83be3411427d5d9597
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
ff8f94459cd29ad0fca2dc8f8451c0de80ad71679420a5f31772295beb4eaa77
BLAKE2b-256 checksum
How to use checksums
0c83cff253fc69375d0045f540065a8a9bc13fd299e31c3004dbce942fa15518
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
352f6d362d8e6ada9b1c4b0c18e24975acc98b697ca4ea6af7e87ae826a51efd
BLAKE2b-256 checksum
How to use checksums
7f8829cf3b84eaef17379c5c6a7141bb62d07db1155fd86e879a8b909a55acb6
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
4feac6c4e0b30966099363f09abb49dfe7bf8d8947f24871c5ec66a6f6c98be8
BLAKE2b-256 checksum
How to use checksums
84d49f98a82e2fd9090a2a0fda6a8f19512657144fb960df79c07d1d8c3e6fb4
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 Nov 1, 2026.

Transparency log

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

Download URL belfort_torch_mlir-2026.11.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
4015eb086dccadb92ae08e95882dff4ee018d42157455b4cccbf4b43c2e2e6e4
BLAKE2b-256 checksum
How to use checksums
e83253c91db83ea26576a7581a788e7a6310b6e0b2c427bc40e4481c947871bd
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 Nov 1, 2026.

Transparency log

Security for belfort-torch-mlir 2026.11.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 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for belfort_torch_mlir-2026.11.1-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 Nov 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