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 20261101

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 20261101
File Actions
torch_mlir-20261101-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for torch_mlir-20261101-cp312-abi3-win_amd64.whl
torch_mlir-20261101-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-20261101-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261101-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-20261101-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261101-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for torch_mlir-20261101-cp312-abi3-macosx_11_0_arm64.whl
torch_mlir-20261101-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for torch_mlir-20261101-cp311-cp311-win_amd64.whl
torch_mlir-20261101-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-20261101-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261101-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-20261101-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261101-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for torch_mlir-20261101-cp311-cp311-macosx_11_0_arm64.whl
torch_mlir-20261101-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for torch_mlir-20261101-cp310-cp310-win_amd64.whl
torch_mlir-20261101-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for torch_mlir-20261101-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
torch_mlir-20261101-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for torch_mlir-20261101-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
torch_mlir-20261101-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for torch_mlir-20261101-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 877.0 MB

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

Download URL torch_mlir-20261101-cp312-abi3-win_amd64.whl
Size 84.0 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
de286729468f12327612f459f3457f0655dec83d991962de7c372a796fdeb60f
BLAKE2b-256 checksum
How to use checksums
daf563351a2b26cf05417dd59bcc390d8f28bf1107e9a4ab3144f1edf6cbdc81
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 / torch_mlir-20261101-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261101-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 79.5 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
9864998257cac7bb159de0a5913814a54a982b8bc62971b1a1338c2c4fdfee29
BLAKE2b-256 checksum
How to use checksums
1b6ee681c433957c10cd6a5b61d6be59b6555b4ec719542098b1748c6eece977
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 / torch_mlir-20261101-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261101-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 76.3 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
0a48cd409b32a908408b7535ee10d67fd97f9b4b59899242e33b831a0b20f8a4
BLAKE2b-256 checksum
How to use checksums
e25831e07703961e8970032eb2478f889bcd9577610127c5863398da4aa0942f
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 / torch_mlir-20261101-cp312-abi3-macosx_11_0_arm64.whl

Download URL torch_mlir-20261101-cp312-abi3-macosx_11_0_arm64.whl
Size 52.5 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
90077206f4f57afbab97beb34268dbe1f08ddebef6dd1d2e2971b3525ffba138
BLAKE2b-256 checksum
How to use checksums
eea2ff6df95003ffbb79c1541292d418fd8df01372261b6430257b2142f99143
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 / torch_mlir-20261101-cp311-cp311-win_amd64.whl

Download URL torch_mlir-20261101-cp311-cp311-win_amd64.whl
Size 84.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
2080a0eeee991c4acc951bc33cb041742f5c7b8f4ebbb69e84045ff32a4ecd4d
BLAKE2b-256 checksum
How to use checksums
d766c472aa521654713e0195db15e8e5b39375fd1d20328fe91d2336b0a218b3
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 / torch_mlir-20261101-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261101-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 79.5 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e55afe7e8d97b7a0ebc1ebd6877d157c49102695ecf9f11fe1ce5ce656306edf
BLAKE2b-256 checksum
How to use checksums
ebfb221442c46923a524b75946dbd00f6ac919a290802469dd4226ccda95fba1
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 / torch_mlir-20261101-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261101-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 76.3 MB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
5e0ee235ba7251be7a72a860ab4ec7325343525cf81c88cfdcd2532faa77843b
BLAKE2b-256 checksum
How to use checksums
23519d689a300060cbe741d25cf19795dd47a19a6f0538311a512b982dc7e82c
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 / torch_mlir-20261101-cp311-cp311-macosx_11_0_arm64.whl

Download URL torch_mlir-20261101-cp311-cp311-macosx_11_0_arm64.whl
Size 52.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c3978be0acf572969e7ccb51409cd244f9a7cc89337da2a2a483b7d9642d6361
BLAKE2b-256 checksum
How to use checksums
65250310aaa9c54ee8b6f60e49fecc648598d56d8a6a8de8af61d1def2f71b47
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 / torch_mlir-20261101-cp310-cp310-win_amd64.whl

Download URL torch_mlir-20261101-cp310-cp310-win_amd64.whl
Size 84.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
f20afbc99041084c3782c88e7714f90fcdc26ae21405b8114f0ee0e9b9352950
BLAKE2b-256 checksum
How to use checksums
5651bf53e2b0da09832eb8a2d3901a1ae82ee2d7dde98031a8f12a8cb30077c4
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 / torch_mlir-20261101-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL torch_mlir-20261101-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 79.5 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7ed8895ab04cceff6abdc6215f6e6df90ddffbc92d56f275abbe76ed36ff04b5
BLAKE2b-256 checksum
How to use checksums
27ae6bf435a994c79766e761ab3631610708e82b1708bd0c7faf81202483d63c
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 / torch_mlir-20261101-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL torch_mlir-20261101-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 76.3 MB
Tags CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
3fae6a8dfb019cf21367302a7dde8a882d6b0b253014197d079949adc3bcc6f0
BLAKE2b-256 checksum
How to use checksums
ef9ed073c57bbc146bfd13ba3b212bdb534d05455ba047b07f1a7fd2f6dde999
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 / torch_mlir-20261101-cp310-cp310-macosx_11_0_arm64.whl

Download URL torch_mlir-20261101-cp310-cp310-macosx_11_0_arm64.whl
Size 52.5 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd8b01a8a3bc960d7cfbf488f0e9a4dd385609cccf350739e5af35cd09878e17
BLAKE2b-256 checksum
How to use checksums
4725c7f20876e42e011bc3d938dfb99bc2f86eaa6dcb34fae92c2d6933d0132f
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 torch-mlir 20261101

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-20261101-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 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