Skip to content

Commit 075f06f

Browse files
author
Suraj Pai
authored
Merge branch 'dev' into mednext
2 parents bfff9a2 + 64eee8c commit 075f06f

File tree

112 files changed

+6090
-538
lines changed

Some content is hidden

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

112 files changed

+6090
-538
lines changed

.github/workflows/cron.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ jobs:
1313
strategy:
1414
matrix:
1515
environment:
16-
- "PT191+CUDA113"
1716
- "PT110+CUDA113"
18-
- "PT113+CUDA113"
19-
- "PTLATEST+CUDA121"
17+
- "PT113+CUDA118"
18+
- "PT210+CUDA121"
19+
- "PTLATEST+CUDA124"
2020
include:
2121
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
2222
- environment: PT110+CUDA113
2323
pytorch: "torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu113"
2424
base: "nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
25-
- environment: PT113+CUDA113
26-
pytorch: "torch==1.13.1 torchvision==0.14.1 --extra-index-url https://download.pytorch.org/whl/cu113"
27-
base: "nvcr.io/nvidia/pytorch:21.06-py3" # CUDA 11.3
28-
- environment: PT113+CUDA122
25+
- environment: PT113+CUDA118
2926
pytorch: "torch==1.13.1 torchvision==0.14.1 --extra-index-url https://download.pytorch.org/whl/cu121"
30-
base: "nvcr.io/nvidia/pytorch:23.08-py3" # CUDA 12.2
27+
base: "nvcr.io/nvidia/pytorch:22.10-py3" # CUDA 11.8
28+
- environment: PT210+CUDA121
29+
pytorch: "pytorch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121"
30+
base: "nvcr.io/nvidia/pytorch:23.08-py3" # CUDA 12.1
3131
- environment: PTLATEST+CUDA124
3232
pytorch: "-U torch torchvision --extra-index-url https://download.pytorch.org/whl/cu121"
33-
base: "nvcr.io/nvidia/pytorch:24.03-py3" # CUDA 12.4
33+
base: "nvcr.io/nvidia/pytorch:24.08-py3" # CUDA 12.4
3434
container:
3535
image: ${{ matrix.base }}
3636
options: "--gpus all"
@@ -80,7 +80,7 @@ jobs:
8080
if: github.repository == 'Project-MONAI/MONAI'
8181
strategy:
8282
matrix:
83-
container: ["pytorch:23.08", "pytorch:24.03"]
83+
container: ["pytorch:23.08", "pytorch:24.08"]
8484
container:
8585
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
8686
options: "--gpus all"
@@ -129,7 +129,7 @@ jobs:
129129
if: github.repository == 'Project-MONAI/MONAI'
130130
strategy:
131131
matrix:
132-
container: ["pytorch:24.03"]
132+
container: ["pytorch:24.08"]
133133
container:
134134
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
135135
options: "--gpus all"
@@ -233,7 +233,7 @@ jobs:
233233
if: github.repository == 'Project-MONAI/MONAI'
234234
needs: cron-gpu # so that monai itself is verified first
235235
container:
236-
image: nvcr.io/nvidia/pytorch:24.03-py3 # testing with the latest pytorch base image
236+
image: nvcr.io/nvidia/pytorch:24.08-py3 # testing with the latest pytorch base image
237237
options: "--gpus all --ipc=host"
238238
runs-on: [self-hosted, linux, x64, integration]
239239
steps:

.github/workflows/pythonapp-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
4545
base: "nvcr.io/nvidia/pytorch:23.08-py3"
4646
- environment: PT210+CUDA121DOCKER
47-
# 24.03: 2.3.0a0+40ec155e58.nv24.3
47+
# 24.08: 2.3.0a0+40ec155e58.nv24.3
4848
pytorch: "-h" # we explicitly set pytorch to -h to avoid pip install error
49-
base: "nvcr.io/nvidia/pytorch:24.03-py3"
49+
base: "nvcr.io/nvidia/pytorch:24.08-py3"
5050
container:
5151
image: ${{ matrix.base }}
5252
options: --gpus all --env NVIDIA_DISABLE_REQUIRE=true # workaround for unsatisfied condition: cuda>=11.6

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
- name: Install dependencies
152152
run: |
153153
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
154-
python -m pip install --user --upgrade pip setuptools wheel twine
154+
python -m pip install --user --upgrade pip setuptools wheel twine packaging
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

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install setuptools
2626
run: |
27-
python -m pip install --user --upgrade setuptools wheel
27+
python -m pip install --user --upgrade setuptools wheel packaging
2828
- name: Build and test source archive and wheel file
2929
run: |
3030
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
106106
git describe
107-
python -m pip install --user --upgrade setuptools wheel
107+
python -m pip install --user --upgrade setuptools wheel packaging
108108
python setup.py build
109109
cat build/lib/monai/_version.py
110110
- name: Upload version

.github/workflows/weekly-preview.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ on:
55
- cron: "0 2 * * 0" # 02:00 of every Sunday
66

77
jobs:
8+
flake8-py3:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
opt: ["codeformat", "pytype", "mypy"]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.9'
19+
- name: cache weekly timestamp
20+
id: pip-cache
21+
run: |
22+
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
23+
- name: cache for pip
24+
uses: actions/cache@v4
25+
id: cache
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
29+
- name: Install dependencies
30+
run: |
31+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
32+
python -m pip install --upgrade pip wheel
33+
python -m pip install -r requirements-dev.txt
34+
- name: Lint and type check
35+
run: |
36+
# clean up temporary files
37+
$(pwd)/runtests.sh --build --clean
38+
# Github actions have 2 cores, so parallelize pytype
39+
$(pwd)/runtests.sh --build --${{ matrix.opt }} -j 2
40+
841
packaging:
942
if: github.repository == 'Project-MONAI/MONAI'
1043
runs-on: ubuntu-latest
@@ -19,7 +52,7 @@ jobs:
1952
python-version: '3.9'
2053
- name: Install setuptools
2154
run: |
22-
python -m pip install --user --upgrade setuptools wheel
55+
python -m pip install --user --upgrade setuptools wheel packaging
2356
- name: Build distribution
2457
run: |
2558
export HEAD_COMMIT_ID=$(git rev-parse HEAD)

Dockerfile

Lines changed: 2 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.03-py3
14+
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:24.08-py3
1515
FROM ${PYTORCH_IMAGE}
1616

1717
LABEL maintainer="[email protected]"
@@ -56,4 +56,5 @@ RUN apt-get update \
5656
&& rm -rf /var/lib/apt/lists/*
5757
# append /opt/tools to runtime path for NGC CLI to be accessible from all file system locations
5858
ENV PATH=${PATH}:/opt/tools
59+
ENV POLYGRAPHY_AUTOINSTALL_DEPS=1
5960
WORKDIR /opt/monai

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
[![postmerge](https://img.shields.io/github/checks-status/project-monai/monai/dev?label=postmerge)](https://github.com/Project-MONAI/MONAI/actions?query=branch%3Adev)
1515
[![Documentation Status](https://readthedocs.org/projects/monai/badge/?version=latest)](https://docs.monai.io/en/latest/)
1616
[![codecov](https://codecov.io/gh/Project-MONAI/MONAI/branch/dev/graph/badge.svg?token=6FTC7U1JJ4)](https://codecov.io/gh/Project-MONAI/MONAI)
17+
[![monai Downloads Last Month](https://assets.piptrends.com/get-last-month-downloads-badge/monai.svg 'monai Downloads Last Month by pip Trends')](https://piptrends.com/package/monai)
1718

1819
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 [PyTorch Ecosystem](https://pytorch.org/ecosystem/).
1920
Its ambitions are:

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ onnxruntime; python_version <= '3.10'
4141
zarr
4242
huggingface_hub
4343
pyamg>=5.0.0
44+
packaging
45+
polygraphy

docs/source/apps.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,22 @@ FastMRIReader
248248
~~~~~~~~~~~~~
249249
.. autofunction:: monai.apps.reconstruction.complex_utils.complex_conj
250250

251+
`Vista3d`
252+
---------
253+
.. automodule:: monai.apps.vista3d.inferer
254+
.. autofunction:: point_based_window_inferer
255+
256+
.. automodule:: monai.apps.vista3d.transforms
257+
.. autoclass:: VistaPreTransformd
258+
:members:
259+
.. autoclass:: VistaPostTransformd
260+
:members:
261+
.. autoclass:: Relabeld
262+
:members:
263+
264+
.. automodule:: monai.apps.vista3d.sampler
265+
.. autofunction:: sample_prompt_pairs
266+
251267
`Auto3DSeg`
252268
-----------
253269
.. automodule:: monai.apps.auto3dseg
@@ -261,11 +277,3 @@ FastMRIReader
261277

262278
.. autoclass:: monai.apps.nnunet.nnUNetV2Runner
263279
:members:
264-
265-
`Generative AI`
266-
---------------
267-
268-
`MAISI Utilities`
269-
~~~~~~~~~~~~~~~~~
270-
.. automodule:: monai.apps.generation.maisi.utils.morphological_ops
271-
:members:

docs/source/config_syntax.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Content:
1616
- [`$` to evaluate as Python expressions](#to-evaluate-as-python-expressions)
1717
- [`%` to textually replace configuration elements](#to-textually-replace-configuration-elements)
1818
- [`_target_` (`_disabled_`, `_desc_`, `_requires_`, `_mode_`) to instantiate a Python object](#instantiate-a-python-object)
19+
- [`+` to alter semantics of merging config keys from multiple configuration files](#multiple-config-files)
1920
- [The command line interface](#the-command-line-interface)
2021
- [Recommendations](#recommendations)
2122

@@ -175,6 +176,47 @@ _Description:_ `_requires_`, `_disabled_`, `_desc_`, and `_mode_` are optional k
175176
- `"debug"` -- execute with debug prompt and return the return value of ``pdb.runcall(_target_, **kwargs)``,
176177
see also [`pdb.runcall`](https://docs.python.org/3/library/pdb.html#pdb.runcall).
177178

179+
## Multiple config files
180+
181+
_Description:_ Multiple config files may be specified on the command line.
182+
The content of those config files is being merged. When same keys are specifiled in more than one config file,
183+
the value associated with the key is being overridden, in the order config files are specified.
184+
If the desired behaviour is to merge values from both files, the key in second config file should be prefixed with `+`.
185+
The value types for the merged contents must match and be both of `dict` or both of `list` type.
186+
`dict` values will be merged via update(), `list` values - concatenated via extend().
187+
Here's an example. In this case, "amp" value will be overridden by extra_config.json.
188+
`imports` and `preprocessing#transforms` lists will be merged. An error would be thrown if the value type in `"+imports"` is not `list`:
189+
190+
config.json:
191+
```json
192+
{
193+
"amp": "$True"
194+
"imports": [
195+
"$import torch"
196+
],
197+
"preprocessing": {
198+
"_target_": "Compose",
199+
"transforms": [
200+
"$@t1",
201+
"$@t2"
202+
]
203+
},
204+
}
205+
```
206+
207+
extra_config.json:
208+
```json
209+
{
210+
"amp": "$False"
211+
"+imports": [
212+
"$from monai.networks import trt_compile"
213+
],
214+
"+preprocessing#transforms": [
215+
"$@t3"
216+
]
217+
}
218+
```
219+
178220
## The command line interface
179221

180222
In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle.

0 commit comments

Comments
 (0)