-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
qiskit_qasm3 does not build with PyPy #11822
Comments
Woah, haha. Do you know what version of PyO3 is being used in the lockfile for that build? |
I would not imagine that any component of this would actually work with PyPy, but who knows - I don't really know the details of how their hook points to the CPython C API work. Certainly we've never attempted to build PyPy wheels on our side. |
Ohhhh wait sorry, I just clicked through. Yeah, I guess if modules don't have filename attributes on PyPy, then that just isn't going to work. Do you know if they have |
I force-pushed so the failed build is hard to find. It is here. The pyo3 version was v0.20.2.
Yes, I haven't used them either, so I don't know how high a priority this is, but it was at least building in the terra feedstock here.
It seems to work for Python files. It's kind of strange. There's not much information in that PyO3 commit that disabled the function for PyPy. |
Flicking through, it looks like PyO3 uses the semi-private So, while the particular fix here would be super easy, I guess the question is: do we want to keep playing whack-a-mole with PyPy issues post release, when the conda-feedstock tries the build and tells us about them, or do we just want to entirely write off PyPy support now? We've never really considered it before, and I didn't actually realise we were ever trying to build PyPy wheels. We can also punt the question by fixing this particular issue and seeing if further issues actually turn up. |
Yeah this is the first time someone has reported this. FWIW, I saw this coming years ago when we first started using rustworkx as a dependency (and that we don't build pypy wheels for rustworkx) and it's why I put:
in the platform support documentation: https://docs.quantum.ibm.com/start/install#operating-system-support That being said how important is this for the conda build system? I would expect a lot of our dependencies don't support pypy either. EDIT: Oops missed you called out CPython is the only supported platform in the docs already. I will say if we can make it work for you on pypy with very little effort we should do that. It's more this will likely happen again in the future as we use more Rust code in Qiskit and we don't test or build for pypy anywhere. |
Ack, I linked right to that part of the documentation above but glossed over that statement since the section was name "operating system support". Perhaps one action item would be to update that section to be "Operating system and Python implementation support" and then at "other Python interpreters" add "such as PyPy" so it comes up more readily in a search for "qiskit pypy". I am not sure if there are any other likely cases besides PyPy that someone might search for? Maybe wasm/wasi which have been getting more attention recently.
I don't think it has any particular importance. The other maintainer of qiskit-terra had enabled PyPy builds, probably because the automation opens a PR to enable them by default and the build ran without errors. I could just drop PyPy builds and see if anyone asks for them. I opened the issue because they had been building and stopped with 1.0 and I wasn't sure if it was "don't support at all" or a "best effort to keep working" kind of issue. The automation also tried to enable PyPy for Aer but ran into a build error. I didn't understand the build error (but might have been due to missing support from pybind11), so I left the PyPy PR unmerged with a comment that it could be looked at more if anyone wanted it. That was a year ago and I haven't heard anything so far. With
Here is the full failure set. Some of the failures might reflect some hidden assumptions that could be fixed for CPython. It looks like
|
Regarding playing whack-a-mole, I asked the PyPy maintainers about C-API coverage. PyPy should have pretty good coverage of the limited stable C-API, which I think Qiskit is opting into by using the |
We don't really make a choice between Looks like PyO3 switched over to In the mean time, I suppose the question for us is whether we want to accept Footnotes
|
Oh, right, I forgot that you had mentioned
I think we can just maintain the status quo for now of not considering PyPy until someone asks for it but consider making small changes for PyPy if they come up and are otherwise code quality improvements (like if Qiskit actually had been using a deprecated method when there was an alternative that also worked with PyPy, or looking into those test failures). It seems like PyO3 tries to keep good PyPy support and with Qiskit using Besides the test failures, I think the only action item is the documentation change I suggested which I implemented in Qiskit/documentation#844. In the documentation, three tiers of support are defined where support correlates to testing and and publishing binaries. It is stated that Qiskit could be built for other platforms. The discussion doesn't touch on what level of source code modification would be tolerated for running on other platforms, just which ones get tested and get binaries published. The text also distinguishes other interpreters as not supported but I am not sure if that is a stronger statement than just not being listed in the three tiers. |
That all sounds like a plan to me, and thanks for updating the docs, Will. Shall we close this issue as a "won't fix" for the time being, and re-evaluate in the future if we turn up a more pressing demand? |
Sure, we can close this now. I will comment here if PyPy and PyO3 updates allow the Qiskit build to start working again. |
Environment
What is happening?
Qiskit fails to build when using PyPy. Specifically, the qiskit_qasm3 crate fails with
How can we reproduce the issue?
Attempt to run
pip install .
with PyPy3.9.What should happen?
I am not sure 🙂 I know of this page specifying the different tiers of support for operating system versions, but I could not find anything stating if PyPy should be supported. I am just reporting that Qiskit 0.46 does build with PyPy and Qiskit 1.0 does not.
Any suggestions?
The issue is that
PyModule
does not have thefilename
function when using PyPy. The function was disabled here though there is not much explanation for why. Here is where the function is defined in PyO3.Also, I don't personally use Qiskit with PyPy. I was just porting the conda build from 0.46 to 1.0 and found this.
The text was updated successfully, but these errors were encountered: