Skip to content

feat: migrate Python bindings from pybind11 to nanobind#243

Open
hush-coder wants to merge 2 commits intosophgo:masterfrom
hush-coder:fix-issue-237
Open

feat: migrate Python bindings from pybind11 to nanobind#243
hush-coder wants to merge 2 commits intosophgo:masterfrom
hush-coder:fix-issue-237

Conversation

@hush-coder
Copy link

  • Bindings: migrate pymlir, pyfinalmlir, pyruntime_* to nanobind (NB_MODULE, nb::ndarray<>, .def_ro/.def_rw).
  • Build: switch to find_package(nanobind) + nanobind_add_module(... NB_STATIC); add find_package(Python ... Development) at top-level.
  • Dependencies: update requirements.txt/Docker to install nanobind>=2.8.0.
  • Compatibility: keep python/tpu_mlir/RegisterEverything.cpp on pybind11.

@xujm1998
Copy link

xujm1998 commented Sep 12, 2025

您好 感谢您的工作;
功能看起来没有问题
但是在build时若docker环境中不存在nanobind,
可能会造成一些困惑,可以在build.sh中再加上检测和自动安装的功能。
image

我们会在未来的docker中加入nanobind

检查nanobind
@hush-coder
Copy link
Author

抱歉,前段时间被其他工作绊住了

我在build.sh中加入了相关操作

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants