Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pybind11 with nanobind in Catalyst's core #1187

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

joeycarter
Copy link
Contributor

@joeycarter joeycarter commented Oct 7, 2024

Context: The Catalyst core contains two Python extension modules (importable Python modules written in C/C++):

The Python-C++ bindings were originally implemented using pybind11. This PR is part of a larger effort to replace all pybind11 code with nanobind.

Description of the Change:

This change replaces all the pybind11 code in mlir/python/PyCompilerDriver.cpp with the equivalent nanobind objects and operations.

This change also 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, 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 for a list of nanobind's benefits.


[sc-72842]

@joeycarter joeycarter marked this pull request as ready for review October 11, 2024 21:08
@joeycarter joeycarter added the author:build-wheels Run the wheel building workflows on this Pull Request label Oct 11, 2024
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@joeycarter joeycarter marked this pull request as draft October 11, 2024 22:44
@joeycarter joeycarter marked this pull request as ready for review October 15, 2024 13:49
@joeycarter joeycarter marked this pull request as draft October 15, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author:build-wheels Run the wheel building workflows on this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant