Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pybind11 modules from Catalyst's core MLIR libs (#1187)
**Context:** Catalyst's core MLIR libraries originally contained two Python extension modules (importable Python modules written in C/C++): * [mlir/python/PyCompilerDriver.cpp](https://github.com/PennyLaneAI/catalyst/blob/main/mlir/python/PyCompilerDriver.cpp) * [mlir/python/QuantumExtension.cpp](https://github.com/PennyLaneAI/catalyst/blob/main/mlir/python/QuantumExtension.cpp) The Python-C++ bindings were originally implemented using pybind11. This PR is part of a larger effort to replace all pybind11 code with nanobind to to align with our adoption of Python's stable ABI. However, mlir/python/PyCompilerDriver.cpp was removed in PR #1285, and furthermore we have decided to deprecate mlir/python/QuantumExtension.cpp entirely since it was not included in the distributed wheels. Therefore, we can remove all pybind11 code in Catalyst's core MLIR libs, with no need to replace these modules with nanobind. **Description of the Change:** ~This change replaces all the pybind11 code in [mlir/python/PyCompilerDriver.cpp](https://github.com/PennyLaneAI/catalyst/blob/main/mlir/python/PyCompilerDriver.cpp) with the equivalent nanobind objects and operations.~ This change removes the MLIR python module `QuantumExtension` entirely, along with associated tests and infrastructure, since (a) it depends on upstream MLIR Python bindings written in pybind11: [mlir/Bindings/Python/PybindAdaptors.h](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Bindings/Python/PybindAdaptors.h), which would be quite onerous to port to nanobind, and (b) we do not actually use these dialect extensions, nor do we ship them with our wheels. **Benefits:** See Epic [68472](https://app.shortcut.com/xanaduai/epic/68472) for a list of nanobind's benefits. ----- [[sc-72842](https://app.shortcut.com/xanaduai/story/72842/replace-pybind11-with-nanobind-in-catalyst-s-core)]
- Loading branch information