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
13 changes: 5 additions & 8 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: [self-hosted, linux, x64, common]
strategy:
matrix:
pytorch-version: [1.5.0, 1.5.1, 1.6.0, latest]
pytorch-version: [1.5.1, 1.6.0, 1.7.1, latest]
steps:
- uses: actions/checkout@v2
- name: Install the dependencies
Expand All @@ -23,15 +23,12 @@ jobs:
python -m pip uninstall -y torch torchvision
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch torchvision
elif [ ${{ matrix.pytorch-version }} == "1.5.0" ]; then
python -m pip install torch==1.5.0
python -m pip install torchvision==0.6.0
elif [ ${{ matrix.pytorch-version }} == "1.5.1" ]; then
python -m pip install torch==1.5.1
python -m pip install torchvision==0.6.1
python -m pip install torch==1.5.1 torchvision==0.6.1
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0
python -m pip install torchvision==0.7.0
python -m pip install torch==1.6.0 torchvision==0.7.0
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1 torchvision==0.8.2
fi
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down
6 changes: 3 additions & 3 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:20.03-py3 # CUDA 10.2
image: nvcr.io/nvidia/pytorch:20.12-py3 # CUDA 11.1, default for PT 1.8.0
options: --gpus all
runs-on: [self-hosted, linux, x64, common]
steps:
Expand All @@ -28,13 +28,13 @@ jobs:
path: |
~/.cache/pip
~/.cache/torch
key: docker-20-03-py3-pip-${{ steps.pip-cache.outputs.datew }}
key: docker-py3-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install the dependencies
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
python -m pip install torch==1.7.1 torchvision==0.8.2
python -m pip install torch==1.8.0 torchvision==0.9.0
python -m pip install -r requirements-dev.txt
- name: Run integration tests
run: |
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
# caching of these jobs:
# - docker-20-03-py3-pip- (shared)
# - docker-py3-pip- (shared)
# - ubuntu py37 pip-
# - os-latest-pip- (shared)
flake8-py3:
Expand Down Expand Up @@ -80,13 +80,12 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.7.1+cpu torchvision==0.8.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.8.0+cpu torchvision==0.9.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
# min. requirements for windows instances
python -c "f=open('requirements-dev.txt', 'r'); txt=f.readlines(); f.close(); print(txt); f=open('requirements-dev.txt', 'w'); f.writelines(txt[1:12]); f.close()"
- name: Install the dependencies
run: |
python -m pip install torch==1.7.1
python -m pip install torchvision==0.8.2
python -m pip install torch==1.8.0 torchvision==0.9.0
cat "requirements-dev.txt"
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down Expand Up @@ -134,11 +133,11 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.8.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.7.1
python -m pip install torch==1.8.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 @@ -156,15 +155,13 @@ jobs:
strategy:
matrix:
environment:
- "PT15+CUDA101"
- "PT16+CUDA102"
- "PT16+CUDA110"
- "PT17+CUDA102"
- "PT17+CUDA110"
- "PT18+CUDA102"
- "PT18+CUDA112"
include:
- environment: PT15+CUDA101
pytorch: "torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html"
base: "nvcr.io/nvidia/cuda:10.1-devel-ubuntu18.04"
- environment: PT16+CUDA102
pytorch: "torch==1.6.0 torchvision==0.7.0"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
Expand All @@ -179,6 +176,13 @@ jobs:
# 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.0 torchvision==0.9.0"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT18+CUDA112
# we explicitly set pytorch to -h to avoid pip install error
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:21.02-py3"
container:
image: ${{ matrix.base }}
options: --gpus all
Expand All @@ -187,7 +191,10 @@ jobs:
- uses: actions/checkout@v2
- name: apt install
run: |
if [ ${{ matrix.environment }} != "PT16+CUDA110" ]; then \
if [ ${{ matrix.environment }} = "PT16+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT17+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT18+CUDA102" ]
then
PYVER=3.6 PYSFX=3 DISTUTILS=python3-distutils && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
Expand Down Expand Up @@ -217,7 +224,8 @@ jobs:
ln -s /usr/bin/python$PYVER /usr/bin/python`echo $PYVER | cut -c1-1` &&
curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py ; fi
rm get-pip.py;
fi
- name: Install dependencies
run: |
which python
Expand All @@ -231,10 +239,10 @@ jobs:
export CUDA_VISIBLE_DEVICES=$(coverage run -m tests.utils)
echo $CUDA_VISIBLE_DEVICES
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")))'
python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))'
python -c "import monai; monai.config.print_config()"
BUILD_MONAI=1 ./runtests.sh --quick
if [ ${{ matrix.environment }} == "PT16+CUDA110" ]; then
if [ ${{ matrix.environment }} == "PT18+CUDA112" ]; then
# test the clang-format tool downloading once
coverage run -m tests.clang_format_utils
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
# caching of these jobs:
# - docker-20-03-py3-pip- (shared)
# - docker-py3-pip- (shared)
# - ubuntu py36 37 38-pip-
# - os-latest-pip (shared)
coverage-py3:
Expand All @@ -30,7 +30,7 @@ jobs:
path: |
~/.cache/pip
~/.cache/torch
key: docker-20-03-py3-pip-${{ steps.pip-cache.outputs.datew }}
key: docker-py3-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install the dependencies
run: |
which python
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
fail_ci_if_error: false
file: ./coverage.xml

test-py3x:
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,13 @@ def query_memory(n=2):
"""
Find best n idle devices and return a string of device ids.
"""
bash_string = "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used --format=csv,noheader,nounits"
bash_string = "nvidia-smi --query-gpu=utilization.gpu,power.draw,memory.used --format=csv,noheader,nounits"

try:
p1 = Popen(bash_string.split(), stdout=PIPE)
output, error = p1.communicate()
free_memory = [x.split(",") for x in output.decode("utf-8").split("\n")[:-1]]
free_memory = np.asarray(free_memory, dtype=np.float).T
free_memory = np.asarray(free_memory, dtype=float).T
ids = np.lexsort(free_memory)[:n]
except (FileNotFoundError, TypeError, IndexError):
ids = range(n) if isinstance(n, int) else []
Expand Down