-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dependency Version/Deprecation Policy #8303
Comments
I would suggest the creation of a new GitHub issue documenting which monai dependency does not have support for numpy 2 which is preventing the numpy < 2 from being removed. Most major python packages have been updated to be compatible with both Numpy 1 and 2 by following https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-0-specific-advice. The numpy GitHub repository has a pinned issue about numpy 2 ecosystem compatibility detailing which versions of major python packages added numpy 2 support. |
As it relates to versions of dependencies to support as well as versions of Python to support, my recommendation would be to consider adopting SPEC0. This is because monai is ultimately dependent on the core base of numpy. |
Thanks for the info, these are sensible timeframes for dependency support. From a newly created Python environment under Ubuntu 24.04 and all of MONAI's stated dependencies installed, I have the following for dependencies uploaded to PyPI before 2023:
(This was created with There isn't a large number of these but many which are the latest release dependencies of other things. I see that |
I think we should track dependencies based on PyTorch (which is a bit of a weak standard since they don't have an LTS/enterprise strategy). Currently we're still supporting (just bumped to) PyTorch 1.13.1, and it isn't fully compatible with numpy 2.0. I suggest that since our next release is going to be a major release (that is what I recall, sorry if I'm mistaken), then we should use that opportunity to bump both PyTorch and Numpy to 2.x. In particular, perhaps target PyTorch version 2.2 since it is compatible with any Numpy 2.x. I haven't fully thought this thru and y'all have more expertise than me in this, but this is my current thinking... |
From numpy/numpy#26191, it actually appears that PyTorch 2.3.0 was the first version built with Numpy 2 to support runtime with Numpy 1 or 2. MONAI wouldn’t have to require Numpy 2 as PyTorch would still work with some of the last few Numpy 1.x releases. However the PyTorch Windows binaries were messed up and didn’t actually build with Numpy 2 until PyTorch 2.4.1. |
With PyTorch 2.6 released now, if we wanted to support only the most recent two versions we can set the minimum to be 2.4.1 at some point. I think this is feasible since PyTorch doesn't do LTS releases nor fixes old releases as previously discussed. |
My only concern is the statement that we're supporting only the two most recent pyorch releases. They are releasing new versions crazy fast. Pyorch 2.4 was released only 7 months ago (July 2024). Open question...is asking folks to update pyorch every 6-7 months too much, even when working on HEAD? Perhaps this is fine, and when there are critical fixes such as Windows support being fixed then more rapid updates may be needed, but perhaps our default should be a longer timeframe? Just asking, not necessarily suggesting... |
We can say this is what we test with but older versions likely will work, but I'm with you on not wanting to be onerous. Users can configure their own environments to use older versions, but what requirements we state will be those used by pip for installation so they have to be accurate. If we say that we support versions of PyTorch and Numpy which don't get along that could be a problem. |
Another concern is when issues such as this one from dependabot come up, do we address them immediately or decide what is a worthwhile risk? |
Yes it would be a good idea to have dependabot enabled to autoupdate dependencies to address vulnerabilities in the stack. So in that case updating Line 70 in af9e8f9
See Project-MONAI/MONAILabel#1749 where there was original discussion about that project turning on dependabot which it did. Turning it on then resulted in automatic PR creation of Project-MONAI/MONAILabel#1754 to resolve GHSA-9wx4-h78v-vm56. |
MONAI has an existing policy for deprecating components it defines here. For dependencies there isn't as clear a policy to follow in regards to which versions of Python, Numpy, Pytorch, etc. to support. It's important to support older environments as much as is practical so that users with frozen environments have the fewest issues with new versions of MONAI. There are a few considerations that vary by library which need to be composed into a clear policy:
All this means we need to determine:
The text was updated successfully, but these errors were encountered: