| Issue |
243007
|
| Summary |
[mlir][python] Discussion: composing MLIR bindings into downstream native extensions
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
brandon-yujie-sun
|
I’m a downstream MLIR user and would like to discuss upstream support for combining MLIR’s Python bindings with our compiler-specific bindings in a single native extension.
Our use case involves MLIR core APIs, custom dialect bindings, and compiler-specific functionality that are built and distributed together. A single extension suits this packaging model: fewer extension artifacts to build and install, with one entry point coordinating native binding initialization. The user-facing Python API can remain organized into separate modules.
The Python bindings design (https://mlir.llvm.org/docs/Bindings/Python/#composable-modules) already describes downstream integrations that include parts of MLIR alongside other native Python components. I’d like to understand the recommended approach for supporting this composition and whether additional upstream support would be appropriate.
Maybe the MLIR’s standalone dialect example (https://github.com/llvm/llvm-project/tree/main/mlir/examples/standalone) could provide a public demonstration: preserve its Python-facing functionality while allowing MLIR core and the custom dialect bindings to live in one native extension.
Before proposing a particular implementation, I’d appreciate feedback on:
- Is there an existing recommended approach for assembling bindings this way?
- What constraints should upstream support preserve—for example, type registration, initialization order, optional dependencies, or binary compatibility?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs