Skip to content

Commit 8e7d2e2

Browse files
authored
Merge branch 'dev' into 8085-average-precision
2 parents 7a2971a + af9e8f9 commit 8e7d2e2

File tree

929 files changed

+4802
-1805
lines changed

Some content is hidden

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

929 files changed

+4802
-1805
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
(
3535
github.actor == 'Nic-Ma' ||
3636
github.actor == 'wyli' ||
37-
github.actor == 'pxLi' ||
38-
github.actor == 'YanxuanLiu' ||
37+
github.actor == 'wendell-hom' ||
3938
github.actor == 'KumoLiu'
4039
)
4140
steps:

.github/workflows/cron.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
- "PT110+CUDA113"
1717
- "PT113+CUDA118"
1818
- "PT210+CUDA121"
19-
- "PTLATEST+CUDA124"
19+
- "PT240+CUDA126"
20+
- "PTLATEST+CUDA126"
2021
include:
2122
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
2223
- environment: PT110+CUDA113
@@ -28,9 +29,12 @@ jobs:
2829
- environment: PT210+CUDA121
2930
pytorch: "pytorch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121"
3031
base: "nvcr.io/nvidia/pytorch:23.08-py3" # CUDA 12.1
31-
- environment: PTLATEST+CUDA124
32+
- environment: PT240+CUDA126
33+
pytorch: "pytorch==2.4.0 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu121"
34+
base: "nvcr.io/nvidia/pytorch:24.08-py3" # CUDA 12.6
35+
- environment: PTLATEST+CUDA126
3236
pytorch: "-U torch torchvision --extra-index-url https://download.pytorch.org/whl/cu121"
33-
base: "nvcr.io/nvidia/pytorch:24.08-py3" # CUDA 12.4
37+
base: "nvcr.io/nvidia/pytorch:24.10-py3" # CUDA 12.6
3438
container:
3539
image: ${{ matrix.base }}
3640
options: "--gpus all"
@@ -71,7 +75,7 @@ jobs:
7175
if pgrep python; then pkill python; fi
7276
shell: bash
7377
- name: Upload coverage
74-
uses: codecov/codecov-action@v4
78+
uses: codecov/codecov-action@v5
7579
with:
7680
fail_ci_if_error: false
7781
files: ./coverage.xml
@@ -80,7 +84,7 @@ jobs:
8084
if: github.repository == 'Project-MONAI/MONAI'
8185
strategy:
8286
matrix:
83-
container: ["pytorch:23.08", "pytorch:24.08"]
87+
container: ["pytorch:23.08", "pytorch:24.08", "pytorch:24.10"]
8488
container:
8589
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
8690
options: "--gpus all"
@@ -119,7 +123,7 @@ jobs:
119123
if pgrep python; then pkill python; fi
120124
shell: bash
121125
- name: Upload coverage
122-
uses: codecov/codecov-action@v4
126+
uses: codecov/codecov-action@v5
123127
with:
124128
fail_ci_if_error: false
125129
files: ./coverage.xml
@@ -129,7 +133,7 @@ jobs:
129133
if: github.repository == 'Project-MONAI/MONAI'
130134
strategy:
131135
matrix:
132-
container: ["pytorch:24.08"]
136+
container: ["pytorch:24.10"]
133137
container:
134138
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
135139
options: "--gpus all"
@@ -224,7 +228,7 @@ jobs:
224228
if pgrep python; then pkill python; fi
225229
shell: bash
226230
- name: Upload coverage
227-
uses: codecov/codecov-action@v4
231+
uses: codecov/codecov-action@v5
228232
with:
229233
fail_ci_if_error: false
230234
files: ./coverage.xml
@@ -233,7 +237,7 @@ jobs:
233237
if: github.repository == 'Project-MONAI/MONAI'
234238
needs: cron-gpu # so that monai itself is verified first
235239
container:
236-
image: nvcr.io/nvidia/pytorch:24.08-py3 # testing with the latest pytorch base image
240+
image: nvcr.io/nvidia/pytorch:24.10-py3 # testing with the latest pytorch base image
237241
options: "--gpus all --ipc=host"
238242
runs-on: [self-hosted, linux, x64, integration]
239243
steps:

.github/workflows/pythonapp-gpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,6 @@ jobs:
137137
shell: bash
138138
- name: Upload coverage
139139
if: ${{ github.head_ref != 'dev' && github.event.pull_request.merged != true }}
140-
uses: codecov/codecov-action@v4
140+
uses: codecov/codecov-action@v5
141141
with:
142142
files: ./coverage.xml

.github/workflows/setupapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
if pgrep python; then pkill python; fi
7373
shell: bash
7474
- name: Upload coverage
75-
uses: codecov/codecov-action@v4
75+
uses: codecov/codecov-action@v5
7676
with:
7777
fail_ci_if_error: false
7878
files: ./coverage.xml
@@ -119,7 +119,7 @@ jobs:
119119
BUILD_MONAI=1 ./runtests.sh --build --quick --min
120120
coverage xml --ignore-errors
121121
- name: Upload coverage
122-
uses: codecov/codecov-action@v4
122+
uses: codecov/codecov-action@v5
123123
with:
124124
fail_ci_if_error: false
125125
files: ./coverage.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ tests/testing_data/nrrd_example.nrrd
149149
# clang format tool
150150
.clang-format-bin/
151151

152+
# ctags
153+
tags
154+
152155
# VSCode
153156
.vscode/
154157
*.zip

.pre-commit-config.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.6.0
12+
rev: v5.0.0
1313
hooks:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
@@ -26,33 +26,30 @@ repos:
2626
args: ['--autofix', '--no-sort-keys', '--indent=4']
2727
- id: end-of-file-fixer
2828
- id: mixed-line-ending
29-
- repo: https://github.com/charliermarsh/ruff-pre-commit
30-
rev: v0.3.5
29+
- repo: https://github.com/astral-sh/ruff-pre-commit
30+
rev: v0.7.0
3131
hooks:
3232
- id: ruff
3333
args:
3434
- --fix
3535

3636
- repo: https://github.com/asottile/pyupgrade
37-
rev: v3.3.1
37+
rev: v3.19.0
3838
hooks:
3939
- id: pyupgrade
40-
args: [--py37-plus]
41-
name: Upgrade code excluding monai networks
40+
args: [--py39-plus, --keep-runtime-typing]
41+
name: Upgrade code with exceptions
4242
exclude: |
4343
(?x)(
4444
^versioneer.py|
4545
^monai/_version.py|
46-
^monai/networks/| # no PEP 604 for torchscript tensorrt
47-
^monai/losses/ # no PEP 604 for torchscript tensorrt
46+
^monai/networks/| # avoid typing rewrites
47+
^monai/apps/detection/utils/anchor_utils.py| # avoid typing rewrites
48+
^tests/test_compute_panoptic_quality.py # avoid typing rewrites
4849
)
49-
- id: pyupgrade
50-
args: [--py37-plus, --keep-runtime-typing]
51-
name: Upgrade monai networks
52-
files: (?x)(^monai/networks/)
5350
5451
- repo: https://github.com/asottile/yesqa
55-
rev: v1.4.0
52+
rev: v1.5.0
5653
hooks:
5754
- id: yesqa
5855
name: Unused noqa
@@ -69,7 +66,7 @@ repos:
6966
)$
7067
7168
- repo: https://github.com/hadialqattan/pycln
72-
rev: v2.4.0
69+
rev: v2.5.0
7370
hooks:
7471
- id: pycln
7572
args: [--config=pyproject.toml]

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# To build with a different base image
1313
# please run `docker build` using the `--build-arg PYTORCH_IMAGE=...` flag.
14-
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:24.08-py3
14+
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:24.10-py3
1515
FROM ${PYTORCH_IMAGE}
1616

1717
LABEL maintainer="[email protected]"
@@ -41,6 +41,10 @@ RUN cp /tmp/requirements.txt /tmp/req.bak \
4141
COPY LICENSE CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md README.md versioneer.py setup.py setup.cfg runtests.sh MANIFEST.in ./
4242
COPY tests ./tests
4343
COPY monai ./monai
44+
45+
# TODO: remove this line and torch.patch for 24.11
46+
RUN patch -R -d /usr/local/lib/python3.10/dist-packages/torch/onnx/ < ./monai/torch.patch
47+
4448
RUN BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop \
4549
&& rm -rf build __pycache__
4650

@@ -57,4 +61,6 @@ RUN apt-get update \
5761
# append /opt/tools to runtime path for NGC CLI to be accessible from all file system locations
5862
ENV PATH=${PATH}:/opt/tools
5963
ENV POLYGRAPHY_AUTOINSTALL_DEPS=1
64+
65+
6066
WORKDIR /opt/monai

docs/source/networks.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,11 @@ Nets
630630
.. autoclass:: ViTAutoEnc
631631
:members:
632632

633+
`MaskedAutoEncoderViT`
634+
~~~~~~~~~~~~~~~~~~~~~~
635+
.. autoclass:: MaskedAutoEncoderViT
636+
:members:
637+
633638
`FullyConnectedNet`
634639
~~~~~~~~~~~~~~~~~~~
635640
.. autoclass:: FullyConnectedNet

docs/source/transforms.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,18 @@ Utility
11801180
:members:
11811181
:special-members: __call__
11821182

1183+
`TorchIO`
1184+
"""""""""
1185+
.. autoclass:: TorchIO
1186+
:members:
1187+
:special-members: __call__
1188+
1189+
`RandTorchIO`
1190+
"""""""""""""
1191+
.. autoclass:: RandTorchIO
1192+
:members:
1193+
:special-members: __call__
1194+
11831195
`MapLabelValue`
11841196
"""""""""""""""
11851197
.. autoclass:: MapLabelValue
@@ -2253,6 +2265,18 @@ Utility (Dict)
22532265
:members:
22542266
:special-members: __call__
22552267

2268+
`TorchIOd`
2269+
""""""""""
2270+
.. autoclass:: TorchIOd
2271+
:members:
2272+
:special-members: __call__
2273+
2274+
`RandTorchIOd`
2275+
""""""""""""""
2276+
.. autoclass:: RandTorchIOd
2277+
:members:
2278+
:special-members: __call__
2279+
22562280
`MapLabelValued`
22572281
""""""""""""""""
22582282
.. autoclass:: MapLabelValued

environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ channels:
77
dependencies:
88
- numpy>=1.24,<2.0
99
- pytorch>=1.9
10+
- torchio
1011
- torchvision
1112
- pytorch-cuda>=11.6
1213
- pip

0 commit comments

Comments
 (0)