-
Notifications
You must be signed in to change notification settings - Fork 160
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
Numpy 2.0 #210
Comments
@da-wad Thanks for the heads up. We've not yet looked at the impact of Numpy 2.0. Are you aware of anything in particular that will require changes to zfpy? |
Nothing more than what is in the summary text in that issue. But: "the NumPy C ABI will change in 2.0, so any compiled extension modules that rely on NumPy are likely to break, they need to be recompiled." may mean that compiling new wheels is all we need to do. However, I think this highlights the need for some distance between zfpy and zfp versioning... |
JFYI 3 weeks ago, NumPy 2.0.0rc1 was tagged. Packages were built for conda & wheels: numpy/numpy#24300 (comment) Would add NumPy has put together a migration guide. More details are in the release notes If zfpy make use of NumPy's C API (and produces wheels that use it), having a release of zfpy 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 zfpy's current support status (with any plans) in this issue: numpy/numpy#26191 |
@jakirkham Thanks for the heads up. We are currently looking for someone to help out with maintaining zfpy and building wheels as we're short on staff and expertise in this area. Any contributions would be welcome and appreciated. |
Would recommend using whatever build script is used currently and try NumPy 2 instead (maybe drop Given the light usage of NumPy in zfpy, it is possible that is all that is needed |
Had a bit of a look around, and I think @jakirkham is right. Assuming the current build setup works (it doesn't look very "formal"): all that should be needed is replacing |
I added #231, let's see what happens. |
Update from #231 (comment). I see two warnings:
I don't think those are new (due to 2.0) though. Tests are passing, so I think it's ok? |
Yes they are ancient, but we didn't enforce them now, there was just little point. |
This is breaking with numpy 2.0.0. Looks like a change to numpy's array struct.
If I build using (after updating setup.py / pyproject.toml)
the problem disappears. |
Yes this is a known issue. The builds are not compatible with NumPy 2. Would stick with NumPy 1 for now if you need zfpy |
As a stopgap, is there any chance a new release of |
@dstansby I'm willing to entertain this, though I don't know what's involved. Is this as simple as adding One concern I have is that even a minor release involves significant effort. If we based the release off the latest Since transitioning from Travis to Actions, we also have a new process for building wheels that I'm unfamiliar with. @da-wad used to handle this; we'd either have to rely on him or on someone more knowledgable than me to get the wheels built and deployed. Finally, there are some Python related PRs I'd like to consider (like #227, #234, #237) for such a release. No biggies, really, but we no longer have a Python developer on the team. With all this in mind, I wonder how much additional work would be needed to ensure zfpy works with NumPy 2.0. That strikes me as the preferable solution. We're planning a new release in the coming months, so if we can live with these NumPy issues a little longer, I would much rather tackle them as part of the next release. As an alternative to a full blown release, we could consider this an unofficial release by just bumping |
Yes, I think that's correct. I didn't appreciate that building the wheels is quite labour intensive - it's not a huge issue for us over at numcodecs (more a minor inconvenince), so waiting for the next release sounds 👍 to me |
I actually noticed two places (I think in the tests) that use @dstansby if you are so inclined and building locally is not a problem, you could probably even just try if I would agree that making the build run smoothly again is most likely the tricky part here, while supporting NumPy 2 is (hopefully!) not a lot of extra work. |
Building the wheels isn't all that labor intensive; doing a complete release of the core C/C++ library is, however. Our release checklist is two dozen tasks, and that does not even include manual testing using various compilers (gcc, clang, icc, pgi, ...) and back ends (different CUDA and HIP versions) not part of our regular CI, leak checks, updates to the Spack package and webpages, proofreading 200+ pages of documentation, etc., on top of testing and deploying the wheels. It's days worth of work, so our releases tend to be less frequent but more substantial. |
@seberg Thanks for suggesting
The rest of the code is Cython, which as I understand is not supported by |
Hi all, I'm also trying to update some dependencies for I can potentially help out with revamping the packaging infrastructure to publish a standards-compliant sdist – I was thinking of opening a PR myself, though I notice efforts towards that area such as #237 are already present right now. I also read through #236 (comment), please let me know and I'll be willing to spend some time contributing and driving something forward, either here or in https://github.com/LLNL/zfpy-wheels/ (or in both places). I decided to file this request and ask around in this issue thread instead of creating a new issue because the discussions here are not exactly orthogonal to my request. As for Pyodide, I can experiment with the tarball from the latest tag (https://github.com/LLNL/zfp/releases/tag/1.0.1) for now, though, and see if that gets us somewhere (but it's better for us to have an sdist handy, of course). If it would be better to open a new issue for this, please let me know and I'll do so. P.S. We don't support the |
From Sebastian ( #210 (comment) ):
From Peter ( #210 (comment) ):
Think Sebastian is referring to these lines in the tests zfp/tests/python/test_numpy.py Line 108 in a46fa8b
zfp/tests/python/test_numpy.py Line 227 in a46fa8b
Not sure why In any event, IIUC Sebastian recommends to replace these with That said, in conda-forge, we just went ahead and rebuilt the existing release as-is with NumPy 2: conda-forge/zfpy-feedstock#37 Looking at the Cython code itself, am not seeing anything obviously problematic with NumPy 2. Maybe others can take another look While the tests should be fixed, users are mainly interested in the library. So Peter, would suggest just rebuilding this wheel maybe with version |
I see no reason why not, except I don't know what's involved.
Any assistance with this would be greatly appreciated. The zfp team currently lacks Python/PyPI expertise, so we'd happily accept any contributions. I've not merged some of the PRs yet as there are multiple outstanding issues and potentially conflicting PRs that need to be addressed, and I was hoping to have someone Python proficient look at all these issues and our new process for deploying wheels before the next release. In addition to the NumPy 2.0 issues discussed here on #210, I would like to make sure we adequately address #201, #227, #231, #233, #234, #237. |
@jakirkham Except for minor changes to the tests, are you saying that no zfpy changes are needed for NumPy 2.0, and that we can just go ahead and build and deploy wheels? |
Right Would honestly even skip the test fixes (given what you have said about the internal release process). Those small changes are not worth that overhead and most users are interested in the library itself (not the test suite) |
Apologies for the radio-silence from my side, I have been away from my inbox for several months on paternity leave which we take very seriously here in Norway! Since getting back I have got some internal approval from work to look into this, but I need to catch up with where we are first. The problems with building zfpy at this time come from the change to setup.py in this commit 63eeefa, which given the placement of the parenthesis, tries to make the statement I'll make a fix for that as soon as I get a chance, and then we can see where we get to. I would very much like it if we can decouple the zfp and zfpy versions though... being able to say zfpy x.x and zfpy x.y both provide zfp z.z would make this much easier - thoughts? |
@da-wad Congrats on parenthood! And thanks for your help with this. I'm a little wary of decoupling versions. I don't expect much independent development of zfp and zfpy, and divorcing them will likely lead to confusion, especially since zfpy is part of zfp. I think a better solution would be to bump Regarding the specific issue with 63eeefa you mentioned, at least one PR addresses it, and it would be good to merge any Python related PRs that we believe should be included. Please see #201, #227, #231, #233, #234, #237. |
Think |
Thanks for pointing me towards those, #237 fixes the bug introduced in 63eeefa and referenced by #233 I suggest merging this PR into develop and then I'll have a go at making wheels for 1.0.1 ... in terms of versioning I can see what you mean about having I suggest bumping the tweak version with merging this PR anyway. Because what we could do in this case is post-releases, whereby we have the zfpy version being Once we've fixed the wheel building then we can look at numpy 2.0 compatibility! |
I expect such a post release to be an exception to the norm, so I'm fine with bumping I'll go ahead and merge #237. Once we've decided we're ready for a post release, I'll update |
If we are ok fixing the Python test suite for NumPy 2 in a However if that complicates making a release happen, would much rather skip them to get the release out faster Just my 2¢ |
Wheels for zfpy 1.0.1 are now built (against numpy 2.xx) and released here on PyPI using zfpy-wheels! This includes all possible combinations of Python 3.9-3.13 and osx/win/linux and x86/arm. It's not strictly 1.0.1 since it includes code from #237 and a few commits ahead of that, but it should be close enough. For the next release I expect setup.py won't be broken and we can have exactly matching PyPI distributions with the main zfp repo tag. @lindstro I am happy for you to close this issue now, but won't close it myself in case there are objections from the conda side of the debate. |
@da-wad Thank you so much for your help with this. I guess the decision was not to bump Is there a way to identify which commit the zfpy wheels are linked to? Back when using Travis CI for deployment, you'd enter the commit hash in #237 took care of several issues for us, including #234, I believe (I'll look into updating the installation documentation in that PR). Can you comment on the status of #201 and #231 and whether they still need to be addressed? Might be nice to address #227, though it does not seem compatible with AppVeyor. Ideally, we'd migrate from AppVeyor to Actions, but I unfortunately don't have the spare cycles at the moment to work on that. |
Numpy 2.0 is coming: numpy/numpy#24300
There will need to be a
zfpy
release built for this, as 1.0.0 wheels will (very likely) not be compatible with numpy 2.xIs anyone looking into this yet?
The text was updated successfully, but these errors were encountered: