Recently, I noticed a couple of these “minimal” MLIR project repos/demos (zincnode/mlir-he, jmgorius/mlir-standalone-template, Lewuathe/mlir-hello). They’re good/solid but to my taste they’re not minimal enough. Since I just finished my PhD in CMake I thought I’d take a crack at putting together a more minimal setup: makslevental/mmlir. It demos a slightly unconventional way to bootstrap an MLIR project:
- It relies on https://makslevental.github.io/wheels for the upstream distribution of MLIR
- It smashes all the include headers into a single header include/MinimalDialect.h and all the tablegen into a single include/MinimalDialect.td and also emits all the tablegen into the source tree itself;
a. I think seeing the emitted tablegen is useful for demystifying how MLIR works - It smashes all the implementation into a single src/MinimalDialect.cpp
- Python bindings @ mmlir/dialects are arranged to have generated artifacts to be dumped in place.
It is primarily meant to be used a learning aid (e.g., for understanding which parts of the upstream CMake are essential and which aren’t) and not as a germ/seed/cookiecutter for a production quality project.
I’ve also set it to build and test nightly (based on nightly builds of MLIR from the wheels repo…) so it’ll stay in sync.