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

Switch pydrake bindings from pybind11 to nanobind #21572

Open
jwnimmer-tri opened this issue Jun 14, 2024 · 0 comments
Open

Switch pydrake bindings from pybind11 to nanobind #21572

jwnimmer-tri opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
component: build system Bazel, CMake, dependencies, memory checkers, linters priority: medium type: feature request

Comments

@jwnimmer-tri
Copy link
Collaborator

jwnimmer-tri commented Jun 14, 2024

Is your feature request related to a problem? Please describe.

Drake's pydrake bindings layer is a pain point in various ways:

  • Must rebuild for every single python minor version we support.
  • Slow compile times.

The former is annoying not only for build times, but also because it takes up way more space on PyPI per release, which leads to things like pypi/support#3226 where we burn through our quota 3-4x faster than we should be doing. Ideally, our bindings library should support Python's Stable API, also know as abi3.

Describe the solution you'd like

Port pydrake to use nanobind instead of pybind11.

Describe alternatives you've considered

There are various other pybind11-inspired bindings libraries, but none of them seem to support abi3.

Additional context

My current thinking is that the first step should be #19250, i.e., removing all of Drake's customization of pybind11. After that, we can follow https://nanobind.readthedocs.io/en/latest/porting.html to move from vanilla pybind11 to nanobind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: build system Bazel, CMake, dependencies, memory checkers, linters priority: medium type: feature request
Development

No branches or pull requests

1 participant