Skip to content

[MLIR][Python] Support defining MLIR passes in Python #155996

@PragmaTwice

Description

@PragmaTwice

For some MLIR projects who mainly work within the Python ecosystem (e.g., Triton, CuTeDSL), defining MLIR passes in Python can be very useful in certain cases. For example, when running experiments or building a quick POC, we often want to prototype rapidly without having to modify complex CMake/C++ code and rebuild the entire MLIR project. Being able to do this directly in Python could improve development efficiency.

There are some related facilities in the MLIR C API (e.g., MlirExternalPass), but they don’t seem to be exposed to Python yet. If this is a direction the community is interested in, I’d be happy to do some initial exploration and firstly provide POC code to enable such support.

(previously discussed on discord: https://discord.com/channels/636084430946959380/642426447167881246/1410805711155495003)

Metadata

Metadata

Assignees

Labels

enhancementImproving things as opposed to bug fixing, e.g. new or missing featuremlir:pythonMLIR Python bindings

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions