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

Updating to match Numpy 2.0 requirements #7857

Merged
merged 16 commits into from
Aug 19, 2024

Conversation

ericspod
Copy link
Member

@ericspod ericspod commented Jun 17, 2024

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

  • 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 <eric.kerfoot@kcl.ac.uk>
ericspod and others added 3 commits June 17, 2024 15:11
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@ericspod ericspod mentioned this pull request Jun 17, 2024
7 tasks
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@ericspod ericspod changed the title Updating use of MAX_SEED to match Numpy 2.0 requirements Updating to match Numpy 2.0 requirements Jun 17, 2024
@ericspod ericspod marked this pull request as draft June 17, 2024 15:51
ericspod and others added 4 commits July 25, 2024 17:25
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 12, 2024

Hi @ericspod ,

Thanks for your quick update for Numpy 2.0.
May I know whether you found any test failures due to 3rd party dependency can't support Numpy 2.0 so far?

Thanks in advance.

@ericspod
Copy link
Member Author

ericspod commented Aug 16, 2024

These appear to be NOT compatible with Numpy2:

  • Pytorch<2.3
  • Pytorch 2.4.0+cpu on Windows?
  • Pyarrow
  • ClearML when using Pyarrow

I, Eric Kerfoot <eric.kerfoot@kcl.ac.uk>, hereby add my Signed-off-by to this commit: 5c0b5f6

Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
@ericspod ericspod marked this pull request as ready for review August 16, 2024 17:16
@ericspod
Copy link
Member Author

@KumoLiu We'll leave the requirements excluding Numpy2 but otherwise updating the minimum version.

environment-dev.yml Outdated Show resolved Hide resolved
ericspod and others added 2 commits August 19, 2024 12:52
Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk>
requirements.txt Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@KumoLiu
Copy link
Contributor

KumoLiu commented Aug 19, 2024

/build

Copy link
Contributor

@KumoLiu KumoLiu left a 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.

@KumoLiu KumoLiu merged commit 3a6f620 into Project-MONAI:dev Aug 19, 2024
28 checks passed
rcremese pushed a commit to rcremese/MONAI that referenced this pull request Sep 2, 2024
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 <eric.kerfoot@kcl.ac.uk>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Numpy 2.0 Behaviour Changes
3 participants