Hey all,
I’m looking to get started with MLIR. My long-term goal is to familiarize myself with the code, and then use it in a personal project to improve my understanding of MLIR, and of compiler tech in general, especially in the context of machine learning code generation.
I’ve been following MLIR from the JAX side of things for a while, and wanted to start by working on the Python bindings. I noticed that some of the nanobind type casters were not yet noexcept
as required by nanobind, so I opened PR #143866 to fix.
It’s not as easy as adding noexcept
everywhere though, and my proposed fix ends in a std::bad_cast
. So naturally, I want to start debugging to learn why, but due to my limited knowledge on debugging Python C++ extensions and lit/LLVM testing, I’m currently stuck.
I read the MLIR Python bindings doc, and managed to piece together a build command and a testing command from the snippets. But the debugging flow currently eludes me. Does anyone have resources / tips for debugging the Python bindings? I’m glad for any hints at this point.
PS: Ideally, in my mind, I would like iterate on the Python bindings by incrementally rebuilding the mlir
wheel upon changes to the source, with a PEP517 build system (scikit-build-core comes to mind, since MLIR uses CMake). Is there potential interest in exploring this route?
Best regards,
Nico