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

Migrating to NumPy 2.0 #1403

Open
scarrazza opened this issue Jul 24, 2024 · 6 comments · May be fixed by #1582
Open

Migrating to NumPy 2.0 #1403

scarrazza opened this issue Jul 24, 2024 · 6 comments · May be fixed by #1582

Comments

@scarrazza
Copy link
Member

At some point, we should also take into account migrating to NumPy 2.0, now that is out.

A much relevant improvement (to us) could be the following:
https://numpy.org/doc/stable/release/2.0.0-notes.html#array-api-compatible-functions-aliases
https://numpy.org/doc/stable/release/2.0.0-notes.html#array-api-compatible-functions-for-numpy-linalg
https://numpy.org/doc/stable/release/2.0.0-notes.html#array-api-standard-support-in-the-main-namespace

It was already documented for v1, and there are compatibility packages available
https://numpy.org/doc/stable/reference/array_api.html
but now it is available by default, and it should improve the compatibility with the other array frameworks (i.e. TensorFlow, PyTorch, JAX, CuPy, ...), since the Python API has been standardized (not all of them adopted it already, but they might do it).

Originally posted by @alecandido in #1395 (comment)

@glpatcern
Copy link

Ciao @MatteoRobbiati, @scarrazza, are you going to look into this migration any time soon?

I've got a request about this from the SWAN service at CERN, as they plan to move to numpy 2.0 and would potentially need to uninstall Qibo.

@MatteoRobbiati
Copy link
Contributor

MatteoRobbiati commented Jan 24, 2025

Ciao @MatteoRobbiati, @scarrazza, are you going to look into this migration any time soon?

I've got a request about this from the SWAN service at CERN, as they plan to move to numpy 2.0 and would potentially need to uninstall Qibo.

Ciao @glpatcern!
We have to solve some dependencies we still have in the tests with machine learning backends (mostly related to Keras and it's integration of Numpy 2.0). After this, we plan to support it indeed!

@glpatcern
Copy link

Hey @MatteoRobbiati, I guess this will take some time yet, right? I see there's also #1484 that is kind of related, but did not find any PR specifically addressing numpy 2.

At the moment, the SWAN team is ready to migrate to a new set of packages that support numpy 2 and python 3.12, and unless we (you) provide some context or roadmap, they may drop Qibo to give precedence to all the rest.

@alecandido
Copy link
Member

Hey @MatteoRobbiati, I guess this will take some time yet, right? I see there's also #1484 that is kind of related, but did not find any PR specifically addressing numpy 2.

Hi @glpatcern. Indeed, the two are actually unrelated.

At the moment, the SWAN team is ready to migrate to a new set of packages that support numpy 2 and python 3.12, and unless we (you) provide some context or roadmap, they may drop Qibo to give precedence to all the rest.

Python 3.12 is fully supported (it came in #1231).

Concerning NumPy 2, I do not see any special dependency issue, nor any major problem. The API is in general pretty similar, so it is mostly (and most likely) a matter of testing, and fixing the minor differences that will arise in the process.
But no one has taken over the task, so I guess it is not happening immediately. Unless someone volunteers for this.

@MatteoRobbiati we may discuss the issue at the next meeting, to see if there is anyone willing to actually perform the migration.

@glpatcern
Copy link

Hi @alecandido, thanks for jumping in - good to learn that the TensorFlow dependency should not be an issue with going to NumPy 2 (with Python 3.12).

Have you had your meeting / did you assess what the migration would entail in terms of actual work?

@alecandido
Copy link
Member

Have you had your meeting / did you assess what the migration would entail in terms of actual work?

I would say, no one volunteered. I will directly check with the most likely candidates (one of which is @MatteoRobbiati himself :P), but otherwise it will just stall...

@alecandido alecandido linked a pull request Feb 10, 2025 that will close this issue
4 tasks
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 a pull request may close this issue.

4 participants