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 NumPy 2.0 #8460

Closed
jakirkham opened this issue May 31, 2024 · 6 comments
Closed

Support NumPy 2.0 #8460

jakirkham opened this issue May 31, 2024 · 6 comments

Comments

@jakirkham
Copy link

Hi All 👋

NumPy is planning to release 2.0 on June 16th ( numpy/numpy#24300 (comment) ). NumPy 2.0.0 RC packages for conda & wheels came out at the beginning of April ( numpy/numpy#24300 (comment) )

Also it looks like PyTorch has added NumPy 2.0 support ( pytorch/pytorch#107302 ) as part of 2.3.0

NumPy has put out a migration guide. More details are in the release notes

If torchvision makes use of NumPy's C API (and produces wheels that use it), having a release of torchvision with wheels built against NumPy 2.0.0rc1 would be helpful to ensure NumPy 1 & 2 compatible wheels (as wheels built against NumPy 1 won't be compatible with NumPy 2). More details in this NumPy 2 ABI doc

Also as NumPy is tracking ecosystem support for NumPy 2.0, it would be helpful to share torchvision current support status in issue (with any plans): numpy/numpy#26191

@rgommers
Copy link

rgommers commented Jun 2, 2024

It looks like some testing and fixes are in order indeed (in progress in gh-8461)

If torchvision makes use of NumPy's C API (and produces wheels that use it)

There should not be such a dependency. numpy isn't a build requirement in pyproject.toml, and there are no numpy headers being used directly.

@NicolasHug
Copy link
Member

Thanks a lot for the update @jakirkham and @rgommers .

From #8461 and #8465 it looks like there's no more errors with numpy 2.0 (CI is mostly red but the relevant unittests-linux jobs are passing). The only required fix was #8463. So torchvision 0.19 should be fully compatible.

I also commented on numpy/numpy#26191 (comment).

@rgommers
Copy link

rgommers commented Jun 3, 2024

Great, thanks @NicolasHug!

@adamjstewart
Copy link
Contributor

It looks like numpy 2 is still not supported on Windows? The wheel has an upper bound on numpy.

@adamjstewart
Copy link
Contributor

Ah, I found #8530 and #8531. Maybe we should reopen this issue?

@NicolasHug
Copy link
Member

No need to re-open this, we're aware of the problem and we're working on a fix. This is tracked in #8531 for torchvision and more generally in pytorch/pytorch#131668 for pytorch, as this isn't a torchvision-specific problem.

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

No branches or pull requests

4 participants