Nanobind for MLIR python bindings

Let us know how it goes. The project has no set policy on any of this, and I somewhat arbitrarily requested that the author include a 5 day testing window specifically because I wanted to err on the side of stress-reduction while not imposing a tax on the contributor to account for all usage. Consider “5” an adjective vs a ticking clock. If we’re still trying to figure out how to make it work or right up against the holidays or something, my personal opinion is that we should aim to not add stress to people’s lives unnecessarily. But let’s make decisions based on feedback/experience vs speculation.

A few other comments inline.

IREE and its derivatives switched 1.5 years go. It has been one of the single best dep decisions I’ve made. Not only is it much-much faster to compile, it produces smaller binaries and has a much more lean interface to the underlying Python machinery that all adds up to significant performance improvements. Worked exactly like it said on the tin.

I’m not there, but based on back-channels in lead up to this, I’m told that Google has had significant, positive experiences too.

It won’t be the last, unfortunately: the Python ecosystem has entered a period of high churn as all of the binding tooling adapts to free-threaded python, the various memory management improvements, and new features, but it had previously been in a pretty long valley of relative stability (and maybe will again – hard to predict).

For both pybind and nanobind projects, we’ve had to move to the latest release as soon as available a couple of times in the last year in order to continue to target the newest Python runtimes and features. I’m sorry to say but I think this churn is more the cost of the Python ecosystem being in a phase of rapid evolution and we’re probably just going to have to keep up. We also have a pending patch that would have required a bump to head on pybind in order to advertise compatibility with certain Python 3.13 features, so there would have been a version bump around now no matter what.

I can’t say I’m fond of this and I know it causes overhead. The only thing I will add is that it is a relatively simple thing to integrate from a packaging standpoint and the author of nanobind is a pro who seems to have a good track record of producing solid releases. There’s really not that much to it, compared to some libraries, so I’m pretty sure there will be a path to integrate it anywhere needed.