-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Updates for Pytorch 2.7 #8429
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
base: dev
Are you sure you want to change the base?
Updates for Pytorch 2.7 #8429
Conversation
Signed-off-by: Eric Kerfoot <[email protected]>
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.
Pull Request Overview
This PR updates MONAI’s torch dependency to a newer version aiming for improved compatibility with PyTorch. The changes include:
- Increasing the minimum torch version in pyproject.toml from 2.3.0 to 2.4.1.
- Updating the installation command in the GitHub Actions workflow (pythonapp.yml) accordingly.
- Modifying the torch version matrix in the minimal workflow (pythonapp-min.yml).
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
pyproject.toml | Updated minimum torch dependency and Black target versions |
.github/workflows/pythonapp.yml | Updated torch installation command to new dependency |
.github/workflows/pythonapp-min.yml | Revised torch version matrix for testing |
Files not reviewed (2)
- docs/requirements.txt: Language not supported
- setup.cfg: Language not supported
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
It's possible the CPU provided by the Windows runner is too old for PyTorch 2.7 which may now require instructions it doesn't have. |
The issue with Windows appears to be related to float 64 calculations, specifically with |
I think I've traced the issue to apparently a bug in |
Thank you for looking into this! Instead of waiting for a fix from PyTorch, do you think it's possible to implement a workaround by altering the dtype for Windows operating systems? |
I'm looking into that now and will hopefully have something soon. We may have to convert to float32 and back in places so we may have knock-on precision issues. |
We may need waiting for the release from torch-tensorrt to support PyTorch2.7. |
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
for more information, see https://pre-commit.ci
…uld be removed when PyTorch is updated. Signed-off-by: Eric Kerfoot <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Hi @KumoLiu this got through the Windows tests now. I raised the issue with PyTorch so hopefully version 2.7.1 will resolve the issue, in the meantime we can run the blossom tests and discuss whether to merge this. |
Signed-off-by: Eric Kerfoot <[email protected]>
/build |
Error log:
|
/build |
Signed-off-by: Eric Kerfoot <[email protected]>
The blossom issue is related to the current pytype version, so I've added |
/build |
Seems related to the new version of the pip: https://pypi.org/project/pip/#history raise issue here: google/pytype#1909 |
Description
This will update MONAI to be compatible with PyTorch 2.7. There appear to be few code changes with this release so hopefully this will be simply a matter of updating versions.
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.