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

Support Python 3.13 #1484

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Support Python 3.13 #1484

wants to merge 2 commits into from

Conversation

alecandido
Copy link
Member

@alecandido alecandido commented Oct 10, 2024

Since py3.13 has been finally published (on Monday), I tried out of curiosity whether it was possible to upgrade our version constraint to use that.

We do not directly rely on Python internals, and py3.x versions are backward compatible (in principle). So, there is no reason for Qibo not to support it, for as long as our dependencies support that.

So, it was just a matter of running poetry lock, and... it seems working.

Now, we still need to solve the Qibojit problem (that in the meanwhile became also a Qibotn one, and soon Qiboml as well).

I expected this to be blocked by TensorFlow once again. And it should, since they are not distributing wheels for py3.13 yet (and they apparently won't before next year tensorflow/tensorflow#62003 (comment)), but apparently they didn't care declaring it
https://github.com/tensorflow/tensorflow/blob/a2fadc33162b16989eb10a541d112e6b9fffa0e1/tensorflow/tools/pip_package/setup.py#L412
and Poetry is not examining the wheel compatibility, so we already got a valid lockfile anyhow.

While going through Qibojit and the rest of it (following the much beloved procedure in #1231 (comment)) further problems may arise. But, at this point, I will have a try soon, also to track the present blockers.

@alecandido
Copy link
Member Author

The CI is of course failing, since I had to disable qibojit and qibotn to lock. Re-enabling them is the missing part to complete this PR.

@cosenal
Copy link

cosenal commented Jan 7, 2025

Ciao @alecandido, any update on this? Qibo is one dependency that is blocking Mitiq to support Python 3.13.

@alecandido
Copy link
Member Author

@cosenal thanks for reaching about this, we're now in a better situation than last time (i.e. #1231), but still not optimal. Let me explain.

Before Qibo was locked behind TensorFlow, which was still the case in October, when I opened this PR.
While NumPy and some other packages have now synced their release cycle with Python's one (which I guess was the main reason for Python itself to establish a well-predictable schedule), so they are already upgrading compatibility based on beta releases, making them ready by October. However, TensorFlow is much slower (certainly not the only major one, but essentially the only one among Qibo's dependencies).

What happened in the last few months is the final migration of the differentiable computation support of Qibo to Qiboml https://github.com/qiboteam/qiboml.
This makes Qibo (almost) independent of TensorFlow, thus I was able to lock.

Unfortunately, we're still in a situation in which part of the backends are tested in Qibo's CI, thus we should still follow the update procedure outlined in #1231 (comment)
We already had plans to solve this situation, by either deeply reworking the Qibo internals layout (https://github.com/qiboteam/qibo-core) or moving/duplicating part of the tests. But it hasn't happened yet...

Thus, the current issue is that Qiboml will be needed to test the TensorFlow backend in the Qibo CI, right now failing for its absence (actually, first encountering Qibojit's absence, but that can be solved with the above procedure). If the dependency were reinstated, then it would fail because of Qiboml not supporting Python 3.13 - eventually coming back to TensorFlow once more.

So, the original issue is not completely solved, but we're now much closer, since we only have to choose how to handle the test issue, introducing the dependency, and then TensorFlow would be out of the main loop (unless Mitiq explicitly targets the TensorFlow backend - at which point Qibo can't solve the issue, until TensorFlow itself will).

@scarrazza

@scarrazza scarrazza added this to the Qibo 0.2.16 milestone Jan 20, 2025
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.

3 participants