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

Test on numpy 2.0 #688

Open
ricardoV94 opened this issue Apr 2, 2024 · 8 comments · May be fixed by brendan-m-murphy/pytensor#4, #1194 or #689
Open

Test on numpy 2.0 #688

ricardoV94 opened this issue Apr 2, 2024 · 8 comments · May be fixed by brendan-m-murphy/pytensor#4, #1194 or #689

Comments

@ricardoV94
Copy link
Member

Description

We may need to pin <2.0 until any break changes are fixed (or we could be very lucky and nothing would happen). First step is to test, which we can do with RC versions

@Armavica Armavica linked a pull request Apr 3, 2024 that will close this issue
11 tasks
@ricardoV94
Copy link
Member Author

#689 confirmed we need to pin it. CC @maresb

@maresb
Copy link
Contributor

maresb commented Apr 5, 2024

Ok, I can put together a repodata patch to make it retroactive on conda-forge. The first step is to add it to our pyproject.toml, and ideally make a release containing the pin. (Conda-forge core prefers to see such retroactive changes being made for something that's already in the feedstock, so that's why a release would be good.)

Any idea on the timeline before the non-rc release drops?

@ricardoV94
Copy link
Member Author

Any idea on the timeline before the non-rc release drops?

Couldn't find anything conclusive, but sounds like soon: numpy/numpy#24300

maresb added a commit to maresb/pytensor that referenced this issue Apr 6, 2024
This will help with publishing a repodata patch for conda-forge as per
<pymc-devs#688 (comment)>.
This will no longer be necessary when we are finished with
<pymc-devs#689>.
@maresb maresb mentioned this issue Apr 6, 2024
11 tasks
ricardoV94 pushed a commit that referenced this issue Apr 6, 2024
This will help with publishing a repodata patch for conda-forge as per
<#688 (comment)>.
This will no longer be necessary when we are finished with
<#689>.
@maresb
Copy link
Contributor

maresb commented Apr 6, 2024

On the conda-forge side I wrote a repodata patch, and then when I tested it didn't actually do anything...

Happily, in terms of Numpy, the conda-forge infrastructure currently automatically pins numpy<2.0.a0 to ensure binary compatibility, so my repodata patch was redundant. 🎉

There's the question of how to move forward once 2.0 becomes available, and this I'm less sure about. I'm testing adding a pin in conda-forge/pytensor-suite-feedstock#88, but there's the possibility that this interferes with the conda-forge magic (see conda-forge/pytensor-suite-feedstock#35).

My recommendation on how to proceed is that we keep an eye on the pins by checking the artifacts in conda-forge/pytensor-suite-feedstock before merging any of the version update PRs.

I'm very relieved that there is no threat of PyTensor breaking as soon as Numpy 2 is released. 😅

@danieltomasz
Copy link

Here us the issue to track ecosystem compatibility with numpy 2.0 numpy/numpy#26191 (comment)

@seberg
Copy link
Contributor

seberg commented Apr 24, 2024

Hmmm, when looking around, I had stumbled on Aesara fork of Theano, but somehow not pytensor. The one potentitially complicated change is that right now I removed MapIter, because it is terribly slow (in the public API form) but having it public API means dragging.
Aesara was saying that they wanted to get rid of that code anyway, and I am almost betting that calling back into Python might be better than using PyArray_MapIter (e.g. using ufunc.at() is usually now fast, but of course not when running on some older NumPy versions)

Please let me know if this is a big issue, or if I can give some pointers in how to just replace the whole thing.

@jakirkham
Copy link
Contributor

Is there a NumPy 2 tracking issue for PyMC as well?

Searched for one, but didn't find it (though could very easily have missed it)

@ricardoV94
Copy link
Member Author

ricardoV94 commented May 8, 2024

Is there a NumPy 2 tracking issue for PyMC as well?

Searched for one, but didn't find it (though could very easily have missed it)

No, the only blocker for PyMC is PyTensor compatibility with numpy 2.0 (I think)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants