In my neverending quest to bring the word of MLIR to as many people as possible, I’ve started building distros (i.e., ninja install) as python wheels: GitHub - makslevental/mlir-wheels. What does that mean? It means you can do this:
$ pip install mlir -f https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest
which will install a thing that will let you do this:
import mlir
print(mlir.__path__[0])
>>> /home/mlevental/mambaforge/envs/nelli/lib/python3.11/site-packages/mlir
where site-packages/mlir looks like this:
$ tree -L 1 site-packages/mlir
site-packages/mlir
├── bin
├── include
├── lib
├── python_packages
├── share
└── src
i.e., a full distribution of MLIR (and LLVM) that can be used to do out-of-tree builds i.e.,
-DCMAKE_PREFIX_PATH=$(python -c "print(__import__('mlir').__path__[0])")
What’s the point of packaging a primarily binary distribution as a python wheel?
- Using
--extra-index-urlor--find-links, you can include these wheels as a dependency in your requirements.txt, like so:
i.e., releases/expanded_assets/latest works as a pypa-compatible package index.-f https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest mlir==17.0.0+6c7fd723 - The wheels are built using
cibuildwheel, so it’s guaranteed that the distribution ismanylinuxcompatible, and thus can be used a foundation for othermanylinuxcompatible python wheels.
Right now I’m building wheels for {(x86_64, aarch64/arm64/ARM64) ⨯ (linux, mac, windows)} - {(linux, aarch64), (windows, ARM64)}, i.e., arm builds of both linux and windows don’t work yet.
It’s on my todo list but both of these are vexing for their own distinct reasons so who knows
.
The repo kicks off a new build (of TOM of llvm/llvm-project) at '00 01,07,13,19 * * *', i.e., four times a day. If you want some commit that’s not there just open an issue and I’ll kick off a build.
Note, there’s no possible future name collision here because you can’t pip install these from anywhere other than that releases page/index. So I’m not unintentionally (or intentionally) namespace squatting, but if someone thinks I should rename the package to something else, I’m not opposed.
to MS for funding my neverending quest (even if they’re not aware lol).