-
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
Updating to match Numpy 2.0 requirements #7857
Conversation
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Hi @ericspod , Thanks for your quick update for Numpy 2.0. Thanks in advance. |
These appear to be NOT compatible with Numpy2:
|
I, Eric Kerfoot <[email protected]>, hereby add my Signed-off-by to this commit: 5c0b5f6 Signed-off-by: Eric Kerfoot <[email protected]>
@KumoLiu We'll leave the requirements excluding Numpy2 but otherwise updating the minimum version. |
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks good to me.
Fixes Project-MONAI#7856. ### Description This introduces changes to meet Numpy 2.0 requirements. MONAI itself is compatible with Numpy 2.0 however some dependencies are not such as older versions of Pytorch. This PR adjusts the MAX_SEED value to be compatible with Numpy 2.0 behaviour changes, uses the `ptp` function, and some other minor tweaks. The versions for dependencies are also fixed to exclude Numpy 2.0. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Eric Kerfoot <[email protected]> Co-authored-by: YunLiu <[email protected]>
Will Numpy 2 be supported soon? Especially as the dependency is due to older versions of pytorch/other libraries and not explicitly support within MONAI itself? is there a reason why MONAI does not drop older versions of pytorch? |
Hi @michael-camilleri The dependency issue for us is that we do want to continue supporting older versions of Pytorch because many users may need older versions for compatibility or because their environment requires it. The problem that everyone has discovered is that their versions strings for Numpy would set a minimum requirement but not a max, so Numpy 2.0 with its incompatibility isn't excluded. Older versions of libraries are unlikely to be updated with support for Numpy 2.0, and we have no way of forcing Numpy 1.x when these are present. For the moment we've chosen to just restrict the version although MONAI itself should be compatible now with the changes made. I think it would work for you to try installing MONAI in an environment (venv or conda) and then installing Numpy 2.0 subsequently. |
Thanks. |
I agree, we can improve the documentation and mention this issue with Numpy 2. Beyond that, we would need a way of directly controlling version resolution in pip to account for known incompatibilities, but this isn't currently possible and would rely on guessing which libraries have a 2.0 problem. |
Yes, I see your point. I think a documentation of the issue within the
installation instructions is enough to be honest, given that it is (in most
cases) an easy fix.
Michael
…On Wed, Nov 27, 2024 at 5:04 PM Eric Kerfoot ***@***.***> wrote:
I agree, we can improve the documentation and mention this issue with
Numpy 2. Beyond that, we would need a way of directly controlling version
resolution in pip to account for known incompatibilities, but this isn't
currently possible and would rely on guessing which libraries have a 2.0
problem.
—
Reply to this email directly, view it on GitHub
<#7857 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKRP37QOIVKWWXZVV7OQDL2CX3QPAVCNFSM6AAAAABJOC2FRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBUGM3TQOBSGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Fixes #7856.
Description
This introduces changes to meet Numpy 2.0 requirements. MONAI itself is compatible with Numpy 2.0 however some dependencies are not such as older versions of Pytorch. This PR adjusts the MAX_SEED value to be compatible with Numpy 2.0 behaviour changes, uses the
ptp
function, and some other minor tweaks. The versions for dependencies are also fixed to exclude Numpy 2.0.Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.