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

Port compiler and iree-dialects to nanobind #19580

Closed
wants to merge 2 commits into from

Conversation

marbre
Copy link
Member

@marbre marbre commented Jan 2, 2025

No description provided.

@marbre marbre changed the title Port compiler and iree-dialects o nanobind Port compiler and iree-dialects to nanobind Jan 2, 2025
@marbre
Copy link
Member Author

marbre commented Jan 2, 2025

Unfortunately, this does not solve the failures we're seeing in the macOS clang workflow (https://github.com/iree-org/iree/actions/runs/12583361482/job/35070746468). Feel free to review but we probably don't want to land this before the release in case we revert the nanobind patch in our llvm fork.

Copy link
Member

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Pretty minimal changes needed and tests all still pass.

IMO let's still revert the changes that broke macOS and then include changes like this after the 3.1.0 release. I want to prioritize derisking releases first and foremost.

Ideas for the PR description:

  • Link to the Discourse thread with context on nanobind vs pybind
  • Include any metrics we have as a result of this change, like binary size changes or performance improvements (the upstream work was motivated by performance improvements for JAX)
  • Mention that now we only have a single library for bindings across the compiler and runtime

@@ -176,6 +176,7 @@ declare_mlir_python_sources(IREECompilerPythonExtensions)
declare_mlir_python_extension(IREECompilerPythonExtensions.Registration
MODULE_NAME _site_initialize_0
ADD_TO_PARENT IREECompilerPythonExtensions
PYTHON_BINDINGS_LIBRARY nanobind
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my Windows machine. Build completed with no errors.

@marbre
Copy link
Member Author

marbre commented Jan 3, 2025

Both works for me :) @makslevental pushed a fix to this branch thus it should build for macOS now. However, I don't have strong feelings and we can revert the relevant commits in our LLVM fork for next week's release and apply them again (as well as this patch) afterwards.

Another option would be to just apply the linker fix (without porting pybind11 to nanobind). I assume that would fix things as well.

Btw, thanks sharing your ideas about improving the PR description. Will take those into account.

@marbre
Copy link
Member Author

marbre commented Jan 23, 2025

Landed with #19789.

@marbre marbre closed this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bindings/python Python wrapping IREE's C API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants