Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.04"] # 21.02, 21.10 for backward comp.
container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.06"] # 21.02, 21.10 for backward comp.
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.04"] # 21.02, 21.10 for backward comp.
container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.06"] # 21.02, 21.10 for backward comp.
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
needs: cron-gpu # so that monai itself is verified first
container:
image: nvcr.io/nvidia/pytorch:22.04-py3 # testing with the latest pytorch base image
image: nvcr.io/nvidia/pytorch:22.06-py3 # testing with the latest pytorch base image
options: "--gpus all --ipc=host"
runs-on: [self-hosted, linux, x64, common]
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
integration-py3:
container:
image: nvcr.io/nvidia/pytorch:21.12-py3 # CUDA 11.5
image: nvcr.io/nvidia/pytorch:22.04-py3 # CUDA 11.6
options: --gpus all # shm-size 4g works fine
runs-on: [self-hosted, linux, x64, common]
steps:
Expand All @@ -34,7 +34,7 @@ jobs:
which python
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
python -m pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r requirements-dev.txt
rm -rf /github/home/.cache/torch/hub/mmars/
- name: Run integration tests
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ jobs:
- "PT17+CUDA102"
- "PT18+CUDA102"
- "PT18+CUDA112"
- "PT111+CUDA116"
- "PT112+CUDA116"
- "PT110+CUDA102"
- "PT111+CUDA102"
- "PT112+CUDA102"
include:
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
- environment: PT17+CUDA102
pytorch: "torch==1.7.1 torchvision==0.8.2"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT18+CUDA102
pytorch: "torch==1.8.1 torchvision==0.9.1"
# pytorch 1.8.2 LTS
pytorch: "torch==1.8.2 torchvision==0.9.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu102"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT18+CUDA112
# we explicitly set pytorch to -h to avoid pip install error
Expand All @@ -44,16 +45,16 @@ jobs:
# 21.10: 1.10.0a0+0aef44c
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:21.10-py3"
- environment: PT111+CUDA116
- environment: PT112+CUDA116
# we explicitly set pytorch to -h to avoid pip install error
# 22.04: 1.12.0a0+bd13bc6
# 22.06: 1.13.0a0+340c412
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:22.04-py3"
base: "nvcr.io/nvidia/pytorch:22.06-py3"
- environment: PT110+CUDA102
pytorch: "torch==1.10.2 torchvision==0.11.3"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT111+CUDA102
pytorch: "torch==1.11.0 torchvision==0.12.0"
- environment: PT112+CUDA102
pytorch: "torch==1.12.0 torchvision==0.13.0"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
container:
image: ${{ matrix.base }}
Expand All @@ -73,7 +74,7 @@ jobs:
if [ ${{ matrix.environment }} = "PT17+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT18+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT110+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT111+CUDA102" ]
[ ${{ matrix.environment }} = "PT112+CUDA102" ]
then
PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/pythonapp-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.12.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.11.0
python -m pip install torch==1.12.0
python -m pip install -r requirements-min.txt
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.11.0
python -m pip install torch==1.12.0
python -m pip install -r requirements-min.txt
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
Expand All @@ -119,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pytorch-version: [1.7.1, 1.8.1, 1.9.1, 1.10.2, latest]
pytorch-version: [1.7.1, 1.8.2, 1.9.1, 1.10.2, 1.11.0, latest]
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -150,12 +150,14 @@ jobs:
python -m pip install torch
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
python -m pip install torch==1.8.1
elif [ ${{ matrix.pytorch-version }} == "1.8.2" ]; then
python -m pip install torch==1.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cpu
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
python -m pip install torch==1.9.1
elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then
python -m pip install torch==1.10.2
elif [ ${{ matrix.pytorch-version }} == "1.11.0" ]; then
python -m pip install torch==1.11.0
fi
python -m pip install -r requirements-min.txt
python -m pip list
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.11.0+cpu torchvision==0.12.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.12.0+cpu torchvision==0.13.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
python -m pip install torch==1.11.0 torchvision==0.12.0
python -m pip install torch==1.12.0 torchvision==0.13.0
cat "requirements-dev.txt"
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
rm -rf $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/ruamel*
python -m pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r requirements-dev.txt
- name: Run unit tests report coverage
run: |
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Install the dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install torch==1.11.0 torchvision==0.12.0
python -m pip install torch==1.12.0 torchvision==0.13.0
python -m pip install -r requirements-dev.txt
- name: Run quick tests CPU ubuntu
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# To build with a different base image
# please run `docker build` using the `--build-arg PYTORCH_IMAGE=...` flag.
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:22.04-py3
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:22.06-py3
FROM ${PYTORCH_IMAGE}

LABEL maintainer="monai.contact@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-f https://download.pytorch.org/whl/cpu/torch-1.6.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
torch>=1.6
pytorch-ignite==0.4.8
pytorch-ignite==0.4.9
numpy>=1.17
itk>=5.2
nibabel
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Full requirements for developments
-r requirements-min.txt
pytorch-ignite==0.4.8
pytorch-ignite==0.4.9
gdown>=4.4.0
scipy
itk>=5.2
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ all =
pillow
tensorboard
gdown>=4.4.0
pytorch-ignite==0.4.8
pytorch-ignite==0.4.9
torchvision
itk>=5.2
tqdm>=4.47.0
Expand Down Expand Up @@ -66,7 +66,7 @@ tensorboard =
gdown =
gdown>=4.4.0
ignite =
pytorch-ignite==0.4.8
pytorch-ignite==0.4.9
torchvision =
torchvision
itk =
Expand Down
4 changes: 4 additions & 0 deletions tests/test_handler_tb_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@

from monai.data import decollate_batch
from monai.handlers import TensorBoardImageHandler
from monai.utils import optional_import

_, has_tb = optional_import("torch.utils.tensorboard", name="SummaryWriter")

TEST_CASES = [[[20, 20]], [[2, 20, 20]], [[3, 20, 20]], [[20, 20, 20]], [[2, 20, 20, 20]], [[2, 2, 20, 20, 20]]]


@unittest.skipUnless(has_tb, "Requires SummaryWriter installation")
class TestHandlerTBImage(unittest.TestCase):
@parameterized.expand(TEST_CASES)
def test_tb_image_shape(self, shape):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_handler_tb_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
from monai.handlers import TensorBoardStatsHandler
from monai.utils import optional_import

SummaryWriter, _ = optional_import("torch.utils.tensorboard", name="SummaryWriter")
SummaryWriter, has_tb = optional_import("torch.utils.tensorboard", name="SummaryWriter")


@unittest.skipUnless(has_tb, "Requires SummaryWriter installation")
class TestHandlerTBStats(unittest.TestCase):
def test_metrics_print(self):
with tempfile.TemporaryDirectory() as tempdir:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_plot_2d_or_3d_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from monai.visualize import plot_2d_or_3d_image
from tests.utils import SkipIfNoModule

SummaryWriter, _ = optional_import("torch.utils.tensorboard", name="SummaryWriter")
SummaryWriter, has_tb = optional_import("torch.utils.tensorboard", name="SummaryWriter")

SummaryWriterX, _ = optional_import("tensorboardX", name="SummaryWriter")

Expand All @@ -35,6 +35,7 @@
TEST_CASE_5 = [(1, 3, 10, 10, 10)]


@unittest.skipUnless(has_tb, "Requires SummaryWriter installation")
class TestPlot2dOr3dImage(unittest.TestCase):
@parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4, TEST_CASE_5])
def test_tb_image(self, shape):
Expand Down