Skip to content

Commit 955dc53

Browse files
authored
Merge branch 'dev' into bugfix/attention-remove-unused-parameters
2 parents 1411564 + 2e391c8 commit 955dc53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+928
-725
lines changed

.github/workflows/cron.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,13 @@ jobs:
1313
strategy:
1414
matrix:
1515
environment:
16-
- "PT110+CUDA113"
17-
- "PT113+CUDA118"
18-
- "PT210+CUDA121"
16+
- "PT230+CUDA121"
1917
- "PT240+CUDA126"
2018
- "PTLATEST+CUDA126"
2119
include:
2220
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
23-
- environment: PT110+CUDA113
24-
pytorch: "torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu113"
25-
base: "nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
26-
- environment: PT113+CUDA118
27-
pytorch: "torch==1.13.1 torchvision==0.14.1 --extra-index-url https://download.pytorch.org/whl/cu121"
28-
base: "nvcr.io/nvidia/pytorch:22.10-py3" # CUDA 11.8
29-
- environment: PT210+CUDA121
30-
pytorch: "pytorch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121"
21+
- environment: PT230+CUDA121
22+
pytorch: "pytorch==2.3.0 torchvision==0.18.0 --extra-index-url https://download.pytorch.org/whl/cu121"
3123
base: "nvcr.io/nvidia/pytorch:23.08-py3" # CUDA 12.1
3224
- environment: PT240+CUDA126
3325
pytorch: "pytorch==2.4.0 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu121"

.github/workflows/pythonapp-gpu.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,21 @@ jobs:
2222
strategy:
2323
matrix:
2424
environment:
25-
- "PT19+CUDA114DOCKER"
26-
- "PT110+CUDA111"
27-
- "PT112+CUDA118DOCKER"
28-
- "PT113+CUDA116"
29-
- "PT210+CUDA121DOCKER"
25+
- "PT230+CUDA124DOCKER"
26+
- "PT240+CUDA125DOCKER"
27+
- "PT250+CUDA126DOCKER"
3028
include:
3129
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
32-
- environment: PT110+CUDA111
33-
pytorch: "torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu111"
34-
base: "nvcr.io/nvidia/cuda:11.1.1-devel-ubuntu18.04"
35-
- environment: PT112+CUDA118DOCKER
36-
# 22.09: 1.13.0a0+d0d6b1f
30+
- environment: PT230+CUDA124DOCKER
31+
# 24.04: 2.3.0a0+6ddf5cf85e
3732
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
38-
base: "nvcr.io/nvidia/pytorch:22.09-py3"
39-
- environment: PT113+CUDA116
40-
pytorch: "torch==1.13.1 torchvision==0.14.1"
41-
base: "nvcr.io/nvidia/cuda:11.6.1-devel-ubuntu18.04"
42-
- environment: PT210+CUDA121DOCKER
43-
# 23.08: 2.1.0a0+29c30b1
33+
base: "nvcr.io/nvidia/pytorch:24.04-py3"
34+
- environment: PT240+CUDA125DOCKER
35+
# 24.06: 2.4.0a0+f70bd71a48
4436
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
45-
base: "nvcr.io/nvidia/pytorch:23.08-py3"
46-
- environment: PT210+CUDA121DOCKER
47-
# 24.08: 2.3.0a0+40ec155e58.nv24.3
37+
base: "nvcr.io/nvidia/pytorch:24.06-py3"
38+
- environment: PT250+CUDA126DOCKER
39+
# 24.08: 2.5.0a0+872d972e41
4840
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
4941
base: "nvcr.io/nvidia/pytorch:24.08-py3"
5042
container:
@@ -59,8 +51,7 @@ jobs:
5951
apt-get update
6052
apt-get install -y wget
6153
62-
if [ ${{ matrix.environment }} = "PT110+CUDA111" ] || \
63-
[ ${{ matrix.environment }} = "PT113+CUDA116" ]
54+
if [ ${{ matrix.environment }} = "PT230+CUDA124" ]
6455
then
6556
PYVER=3.9 PYSFX=3 DISTUTILS=python3-distutils && \
6657
apt-get update && apt-get install -y --no-install-recommends \
@@ -94,9 +85,6 @@ jobs:
9485
python get-pip.py && \
9586
rm get-pip.py;
9687
fi
97-
- if: matrix.environment == 'PT19+CUDA114DOCKER'
98-
name: Optional Cupy dependency (cuda114)
99-
run: echo "cupy-cuda114" >> requirements-dev.txt
10088
- name: Install dependencies
10189
if: github.event.pull_request.merged != true
10290
run: |
@@ -128,7 +116,7 @@ jobs:
128116
# build for the current self-hosted CI Tesla V100
129117
BUILD_MONAI=1 TORCH_CUDA_ARCH_LIST="7.0" ./runtests.sh --build --disttests
130118
./runtests.sh --quick --unittests
131-
if [ ${{ matrix.environment }} = "PT113+CUDA116" ]; then
119+
if [ ${{ matrix.environment }} = "PT230+CUDA124" ]; then
132120
# test the clang-format tool downloading once
133121
coverage run -m tests.clang_format_utils
134122
fi

.github/workflows/pythonapp-min.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
strategy:
125125
fail-fast: false
126126
matrix:
127-
pytorch-version: ['1.10.2', '1.11.0', '1.12.1', '1.13', '2.0.1', 'latest']
127+
pytorch-version: ['2.3.1', '2.4.1', '2.5.1', 'latest']
128128
timeout-minutes: 40
129129
steps:
130130
- uses: actions/checkout@v4

.github/workflows/pythonapp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- if: runner.os == 'windows'
9595
name: Install torch cpu from pytorch.org (Windows only)
9696
run: |
97-
python -m pip install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
97+
python -m pip install torch==2.4.1 torchvision==0.19.1+cpu --index-url https://download.pytorch.org/whl/cpu
9898
- if: runner.os == 'Linux'
9999
name: Install itk pre-release (Linux only)
100100
run: |
@@ -103,7 +103,7 @@ jobs:
103103
- name: Install the dependencies
104104
run: |
105105
python -m pip install --user --upgrade pip wheel
106-
python -m pip install torch==1.13.1 torchvision==0.14.1
106+
python -m pip install torch==2.4.1 torchvision==0.19.1
107107
cat "requirements-dev.txt"
108108
python -m pip install -r requirements-dev.txt
109109
python -m pip list
@@ -155,7 +155,7 @@ jobs:
155155
# install the latest pytorch for testing
156156
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
157157
# fresh torch installation according to pyproject.toml
158-
python -m pip install torch>=1.9 torchvision
158+
python -m pip install torch>=2.3.0 torchvision
159159
- name: Check packages
160160
run: |
161161
pip uninstall monai

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818

1919
MONAI is a [PyTorch](https://pytorch.org/)-based, [open-source](https://github.com/Project-MONAI/MONAI/blob/dev/LICENSE) framework for deep learning in healthcare imaging, part of the [PyTorch Ecosystem](https://pytorch.org/ecosystem/).
2020
Its ambitions are as follows:
21+
2122
- Developing a community of academic, industrial and clinical researchers collaborating on a common foundation;
2223
- Creating state-of-the-art, end-to-end training workflows for healthcare imaging;
2324
- Providing researchers with the optimized and standardized way to create and evaluate deep learning models.
2425

25-
2626
## Features
27+
2728
> _Please see [the technical highlights](https://docs.monai.io/en/latest/highlights.html) and [What's New](https://docs.monai.io/en/latest/whatsnew.html) of the milestone releases._
2829
2930
- flexible pre-processing for multi-dimensional medical imaging data;
@@ -32,7 +33,6 @@ Its ambitions are as follows:
3233
- customizable design for varying user expertise;
3334
- multi-GPU multi-node data parallelism support.
3435

35-
3636
## Installation
3737

3838
To install [the current release](https://pypi.org/project/monai/), you can simply run:
@@ -53,30 +53,34 @@ Technical documentation is available at [docs.monai.io](https://docs.monai.io).
5353

5454
## Citation
5555

56-
If you have used MONAI in your research, please cite us! The citation can be exported from: https://arxiv.org/abs/2211.02701.
56+
If you have used MONAI in your research, please cite us! The citation can be exported from: <https://arxiv.org/abs/2211.02701>.
5757

5858
## Model Zoo
59+
5960
[The MONAI Model Zoo](https://github.com/Project-MONAI/model-zoo) is a place for researchers and data scientists to share the latest and great models from the community.
6061
Utilizing [the MONAI Bundle format](https://docs.monai.io/en/latest/bundle_intro.html) makes it easy to [get started](https://github.com/Project-MONAI/tutorials/tree/main/model_zoo) building workflows with MONAI.
6162

6263
## Contributing
64+
6365
For guidance on making a contribution to MONAI, see the [contributing guidelines](https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md).
6466

6567
## Community
68+
6669
Join the conversation on Twitter/X [@ProjectMONAI](https://twitter.com/ProjectMONAI) or join our [Slack channel](https://forms.gle/QTxJq3hFictp31UM9).
6770

6871
Ask and answer questions over on [MONAI's GitHub Discussions tab](https://github.com/Project-MONAI/MONAI/discussions).
6972

7073
## Links
71-
- Website: https://monai.io/
72-
- API documentation (milestone): https://docs.monai.io/
73-
- API documentation (latest dev): https://docs.monai.io/en/latest/
74-
- Code: https://github.com/Project-MONAI/MONAI
75-
- Project tracker: https://github.com/Project-MONAI/MONAI/projects
76-
- Issue tracker: https://github.com/Project-MONAI/MONAI/issues
77-
- Wiki: https://github.com/Project-MONAI/MONAI/wiki
78-
- Test status: https://github.com/Project-MONAI/MONAI/actions
79-
- PyPI package: https://pypi.org/project/monai/
80-
- conda-forge: https://anaconda.org/conda-forge/monai
81-
- Weekly previews: https://pypi.org/project/monai-weekly/
82-
- Docker Hub: https://hub.docker.com/r/projectmonai/monai
74+
75+
- Website: <https://monai.io/>
76+
- API documentation (milestone): <https://docs.monai.io/>
77+
- API documentation (latest dev): <https://docs.monai.io/en/latest/>
78+
- Code: <https://github.com/Project-MONAI/MONAI>
79+
- Project tracker: <https://github.com/Project-MONAI/MONAI/projects>
80+
- Issue tracker: <https://github.com/Project-MONAI/MONAI/issues>
81+
- Wiki: <https://github.com/Project-MONAI/MONAI/wiki>
82+
- Test status: <https://github.com/Project-MONAI/MONAI/actions>
83+
- PyPI package: <https://pypi.org/project/monai/>
84+
- conda-forge: <https://anaconda.org/conda-forge/monai>
85+
- Weekly previews: <https://pypi.org/project/monai-weekly/>
86+
- Docker Hub: <https://hub.docker.com/r/projectmonai/monai>

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-f https://download.pytorch.org/whl/cpu/torch-1.12.1%2Bcpu-cp37-cp37m-linux_x86_64.whl
2-
torch>=1.9
1+
-f https://download.pytorch.org/whl/cpu/torch-2.3.0%2Bcpu-cp39-cp39-linux_x86_64.whl
2+
torch>=2.3.0
33
pytorch-ignite==0.4.11
44
numpy>=1.20
55
itk>=5.2

docs/source/handlers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ ROC AUC metrics handler
5353
:members:
5454

5555

56+
Average Precision metric handler
57+
--------------------------------
58+
.. autoclass:: AveragePrecision
59+
:members:
60+
61+
5662
Confusion matrix metrics handler
5763
--------------------------------
5864
.. autoclass:: ConfusionMatrix

docs/source/metrics.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ Metrics
8080
.. autoclass:: ROCAUCMetric
8181
:members:
8282

83+
`Average Precision`
84+
-------------------
85+
.. autofunction:: compute_average_precision
86+
87+
.. autoclass:: AveragePrecisionMetric
88+
:members:
89+
8390
`Confusion matrix`
8491
------------------
8592
.. autofunction:: get_confusion_matrix

environment-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ channels:
55
- nvidia
66
- conda-forge
77
dependencies:
8-
- numpy>=1.24,<2.0
9-
- pytorch>=1.9
8+
- numpy>=1.24,<3.0
9+
- pytorch>=2.3.0
1010
- torchio
1111
- torchvision
1212
- pytorch-cuda>=11.6

monai/apps/auto3dseg/transforms.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import torch
1919

2020
from monai.config import KeysCollection
21-
from monai.networks.utils import pytorch_after
2221
from monai.transforms import MapTransform
2322
from monai.utils.misc import ImageMetaKey
2423

@@ -74,9 +73,7 @@ def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torc
7473
f", the metadata was not updated {filename}."
7574
)
7675
d[key] = torch.nn.functional.interpolate(
77-
input=d[key].unsqueeze(0),
78-
size=image_shape,
79-
mode="nearest-exact" if pytorch_after(1, 11) else "nearest",
76+
input=d[key].unsqueeze(0), size=image_shape, mode="nearest-exact"
8077
).squeeze(0)
8178
else:
8279
raise ValueError(

0 commit comments

Comments
 (0)