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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ A few sentences describing the changes proposed in this pull request.
- [ ] Breaking change (fix or new feature that would cause existing functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/` folder.
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cron-mmar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:
- name: Loading MMARs
run: |
# clean up temporary files
$(pwd)/runtests.sh --build --clean
$(pwd)/runtests.sh --clean
# run tests
python -m tests.ngc_mmar_loading
16 changes: 8 additions & 8 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand All @@ -62,7 +62,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.12"] # 21.02 for backward comp.
container: ["pytorch:21.02", "pytorch:21.10"] # 21.02 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 @@ -91,8 +91,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand All @@ -106,7 +106,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:21.02", "pytorch:21.12"] # 21.02 for backward comp.
container: ["pytorch:21.02", "pytorch:21.10"] # 21.02 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 @@ -190,8 +190,8 @@ jobs:
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
ngc --version
BUILD_MONAI=1 ./runtests.sh --build --coverage --pytype --unittests --disttests # unit tests with pytype checks, coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
- name: Upload coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.1+cu111 torchvision==0.11.2+cu111 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r requirements-dev.txt
- name: Run integration tests
run: |
Expand All @@ -46,8 +46,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --build --net
BUILD_MONAI=1 ./runtests.sh --build --unittests --disttests
BUILD_MONAI=1 ./runtests.sh --net
BUILD_MONAI=1 ./runtests.sh --unittests
if pgrep python; then pkill python; fi
shell: bash
- name: Add reaction
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,34 @@ jobs:
matrix:
environment:
- "PT17+CUDA102"
- "PT17+CUDA110"
- "PT18+CUDA102"
- "PT18+CUDA112"
- "PT18+CUDA110"
- "PT19+CUDA114"
- "PT110+CUDA115"
- "PT110+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: PT17+CUDA110
# we explicitly set pytorch to -h to avoid pip install error
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:20.09-py3"
- environment: PT18+CUDA102
pytorch: "torch==1.8.1 torchvision==0.9.1"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT18+CUDA112
- environment: PT18+CUDA110
# we explicitly set pytorch to -h to avoid pip install error
# 21.03: 1.9.0a0+df837d0
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:21.03-py3"
base: "nvcr.io/nvidia/pytorch:21.02-py3"
- environment: PT19+CUDA114
# we explicitly set pytorch to -h to avoid pip install error
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
# 21.10: 1.10.0a0+0aef44c
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:21.10-py3"
- environment: PT110+CUDA115
# we explicitly set pytorch to -h to avoid pip install error
# 21.12: 1.11.0a0+b6df043
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:21.12-py3"
- environment: PT110+CUDA102
pytorch: "torch==1.10.1 torchvision==0.11.2"
pytorch: "torch==1.10.0 torchvision==0.11.1"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
container:
image: ${{ matrix.base }}
Expand All @@ -63,7 +61,7 @@ jobs:
[ ${{ matrix.environment }} = "PT18+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT110+CUDA102" ]
then
PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
PYVER=3.6 PYSFX=3 DISTUTILS=python3-distutils && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
pkg-config \
Expand Down Expand Up @@ -124,7 +122,7 @@ jobs:
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
python -c "import monai; monai.config.print_config()"
# build for the current self-hosted CI Tesla V100
BUILD_MONAI=1 TORCH_CUDA_ARCH_LIST="7.0" ./runtests.sh --build --quick --unittests --disttests
BUILD_MONAI=1 TORCH_CUDA_ARCH_LIST="7.0" ./runtests.sh --quick --unittests
if [ ${{ matrix.environment }} = "PT110+CUDA102" ]; then
# test the clang-format tool downloading once
coverage run -m tests.clang_format_utils
Expand Down
8 changes: 4 additions & 4 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.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.10.1
python -m pip install torch==1.10.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 @@ -74,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.10.1
python -m pip install torch==1.10.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
8 changes: 4 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
- name: Lint and type check
run: |
# clean up temporary files
$(pwd)/runtests.sh --build --clean
$(pwd)/runtests.sh --clean
# Git hub actions have 2 cores, so parallize pytype
$(pwd)/runtests.sh --build --codeformat -j 2
$(pwd)/runtests.sh --codeformat -j 2

quick-py3: # full dependencies installed tests for different OS
runs-on: ${{ matrix.os }}
Expand Down 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.10.1+cpu torchvision==0.11.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.10.0+cpu torchvision==0.11.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
python -m pip install torch==1.10.1 torchvision==0.11.2
python -m pip install torch==1.10.0 torchvision==0.11.1
cat "requirements-dev.txt"
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 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.10.1 torchvision==0.11.2
python -m pip install torch==1.10.0 torchvision==0.11.1
python -m pip install -r requirements-dev.txt
- name: Run unit tests report coverage
run: |
Expand All @@ -59,8 +59,8 @@ jobs:
python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null &
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --unittests # unit tests with coverage report
BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report
coverage xml
if pgrep python; then pkill python; fi
shell: bash
Expand All @@ -74,7 +74,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -98,13 +98,13 @@ jobs:
- name: Install the dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install torch==1.10.1 torchvision==0.11.2
python -m pip install torch==1.10.0 torchvision==0.11.1
python -m pip install -r requirements-dev.txt
- name: Run quick tests CPU ubuntu
run: |
python -m pip list
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
BUILD_MONAI=1 ./runtests.sh --build --quick --unittests --disttests
BUILD_MONAI=1 ./runtests.sh --quick --unittests
coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -23,10 +23,10 @@ repos:
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.29.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py36-plus]
name: Upgrade code
exclude: |
(?x)^(
Expand All @@ -35,7 +35,7 @@ repos:
)$

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.2.3
hooks:
- id: yesqa
name: Unused noqa
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python -m pip install -U -r requirements-dev.txt

License information: all source code files should start with this paragraph:
```
# Copyright (c) MONAI Consortium
# Copyright <Year> MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -113,7 +113,7 @@ or (for new features that would not break existing functionality):
```

It is recommended that the new test `test_[module_name].py` is constructed by using only
python 3.7+ build-in functions, `torch`, `numpy`, `coverage` (for reporting code coverages) and `parameterized` (for organising test cases) packages.
python 3.6+ build-in functions, `torch`, `numpy`, `coverage` (for reporting code coverages) and `parameterized` (for organising test cases) packages.
If it requires any other external packages, please make sure:
- the packages are listed in [`requirements-dev.txt`](requirements-dev.txt)
- the new test `test_[module_name].py` is added to the `exclude_cases` in [`./tests/min_tests.py`](./tests/min_tests.py) so that
Expand Down Expand Up @@ -228,7 +228,7 @@ Notably,
for example, ``import monai.transforms.Spacing`` is the equivalent of ``monai.transforms.spatial.array.Spacing`` if
``class Spacing`` defined in file `monai/transforms/spatial/array.py` is decorated with ``@export("monai.transforms")``.

For string definition, [f-string](https://www.python.org/dev/peps/pep-0498/) is recommended to use over `%-print` and `format-print`. So please try to use `f-string` if you need to define any string object.
For string definition, [f-string](https://www.python.org/dev/peps/pep-0498/) is recommended to use over `%-print` and `format-print` from python 3.6. So please try to use `f-string` if you need to define any string object.

#### Backwards compatibility
MONAI is currently under active development, and with major version zero (following the [Semantic Versioning](https://semver.org/)).
Expand Down
Loading