-
Notifications
You must be signed in to change notification settings - Fork 255
Don't crash if inspect.signature() fails on a function during stubgen. #1124
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
Conversation
Use a maximally permissive type instead.
Hi @hawkinsp—For posterity, can you explain in what kind of situation signature generation might fail? |
Sure. In general I might have put anything in my nanobind module, even values not produced by nanobind. That is the case here:
That attribute originates from: https://github.com/jax-ml/jax/blob/dbe98ecb816e277caf45e512cf8225f9d80ca9e0/jaxlib/utils.cc#L367
i.e., it is a nanobind module, but one of the functions in it is not a nanobind function. (Why do this? It's because there is a small but measurable cost to the nanobind argument dispatch for variadic functions, as here. I want to make sure we use the vectorcall protocol without explicitly forming tuples as |
(Edit: copied the wrong error, now fixed). |
Thanks! |
FYI I get a similar sort of error on py3.10 and for v2.7.0:
I dropped a breakpoint and while |
@wjakob can we get a point release with this fix - it's blocking usage of this feature (auto stubgen) in MLIR because we rely on PyPI for getting nanobind in CI. |
@makslevental Can't you make a pyproject.toml (or other distribution method) dependency on a specific branch/commit? This is what I usually do when one of my own project depends a specific very recent commit. |
(To be clear, I plan to make a release soon, but there are some other changes which I want to review and merge first. It might still take 1-2 weeks). |
The issue is we're using artifact hashes for CI https://github.com/llvm/llvm-project/blob/main/.ci/all_requirements.txt#L198 which aren't supported (ironically) by
Either way, I/we can wait for this. Thanks. |
Ah unfortunately the archive doesn't work either because of the |
@makslevental see #403 |
UPDATE: I revoke my request. We're talking about a different solution downstream. |
Use a maximally permissive type instead.