From 4a82b3d46a47ff1d52af890326b9eb9cb5ea72d5 Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 19:03:34 +0800 Subject: [PATCH 1/6] Add CI of pytorch 1.9.0 --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28056d3f05..b5b36ff251 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: python-version: [3.7] - torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0] + torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] include: - torch: 1.3.0 torchvision: 0.4.1 @@ -42,6 +42,10 @@ jobs: torchvision: 0.7.0 - torch: 1.7.0 torchvision: 0.8.1 + - torch: 1.8.0 + torchvision: 0.9.0 + - torch: 1.9.0 + torchvision: 0.10.0 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From a0489309e48b2dccbbe1fc16da289bda7dede010 Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 19:06:56 +0800 Subject: [PATCH 2/6] Update --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5b36ff251..a90371fe53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,7 @@ jobs: strategy: matrix: python-version: [3.7] - torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0] + torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] include: - torch: 1.3.0 torchvision: 0.4.1 @@ -97,6 +97,10 @@ jobs: - torch: 1.7.0 torchvision: 0.8.1 python-version: 3.8 + - torch: 1.8.0 + torchvision: 0.9.0 + - torch: 1.9.0 + torchvision: 0.10.0 steps: - uses: actions/checkout@v2 From 8b8840aec6a94deed1a4b849cdc598ed818ca6d1 Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 21:40:53 +0800 Subject: [PATCH 3/6] Fix --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a90371fe53..cadaa6d7c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,8 +75,8 @@ jobs: runs-on: ubuntu-latest env: - CUDA: 10.1.105-1 - CUDA_SHORT: 10.1 + CUDA: 10.2.89-1 + CUDA_SHORT: 10.2 UBUNTU_VERSION: ubuntu1804 strategy: matrix: From c221efdb2b27fa293eccd00575316a6b9c59164f Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 22:02:11 +0800 Subject: [PATCH 4/6] Split --- .github/workflows/build.yml | 75 +++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cadaa6d7c8..9e4b53ef65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,13 +75,13 @@ jobs: runs-on: ubuntu-latest env: - CUDA: 10.2.89-1 - CUDA_SHORT: 10.2 + CUDA: 10.1.105-1 + CUDA_SHORT: 10.1 UBUNTU_VERSION: ubuntu1804 strategy: matrix: python-version: [3.7] - torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] + torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] include: - torch: 1.3.0 torchvision: 0.4.1 @@ -99,6 +99,75 @@ jobs: python-version: 3.8 - torch: 1.8.0 torchvision: 0.9.0 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: pip install pip --upgrade + - name: Install CUDA + run: | + export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb + wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} + sudo dpkg -i ${INSTALLER} + wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub + sudo apt-key add 7fa2af80.pub + sudo apt update -qq + sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} + sudo apt clean + export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} + export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} + export PATH=${CUDA_HOME}/bin:${PATH} + - name: Install Pillow + run: pip install Pillow==6.2.2 + if: ${{matrix.torchvision < 0.5}} + - name: Install PyTorch + run: | + if [ ${{matrix.torch}} == '1.3.0' ] + then + pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html + else + pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html + fi + - name: Install MMCV + run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html + - name: Install other dependencies + run: pip install -r requirements.txt + - name: Build and install + run: | + rm -rf .eggs + python setup.py check -m -s + TORCH_CUDA_ARCH_LIST=7.0 pip install . + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmedit -m pytest tests/ + coverage xml + coverage report -m + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.10 + with: + file: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false + + + build_cuda102: + runs-on: ubuntu-latest + + env: + CUDA: 10.2.89-1 + CUDA_SHORT: 10.2 + UBUNTU_VERSION: ubuntu1804 + strategy: + matrix: + python-version: [3.7] + torch: [1.9.0] + include: - torch: 1.9.0 torchvision: 0.10.0 From eb3fdb9919f7a4585ff35bc33bab6d9a66a3c804 Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 22:28:45 +0800 Subject: [PATCH 5/6] test CI pt1.9 --- .github/workflows/build.yml | 292 ++++++++++++++++++------------------ 1 file changed, 143 insertions(+), 149 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e4b53ef65..cdfd83efa6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,152 +8,152 @@ on: pull_request: jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install pre-commit hook - run: | - pip install pre-commit - pre-commit install - - name: Linting - run: pre-commit run --all-files - - name: Check docstring coverage - run: | - pip install interrogate - interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit + # lint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - name: Set up Python 3.7 + # uses: actions/setup-python@v2 + # with: + # python-version: 3.7 + # - name: Install pre-commit hook + # run: | + # pip install pre-commit + # pre-commit install + # - name: Linting + # run: pre-commit run --all-files + # - name: Check docstring coverage + # run: | + # pip install interrogate + # interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit - build_cpu: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.7] - torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] - include: - - torch: 1.3.0 - torchvision: 0.4.1 - - torch: 1.5.0 - torchvision: 0.6.0 - - torch: 1.6.0 - torchvision: 0.7.0 - - torch: 1.7.0 - torchvision: 0.8.1 - - torch: 1.8.0 - torchvision: 0.9.0 - - torch: 1.9.0 - torchvision: 0.10.0 - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: pip install pip --upgrade - - name: Install Pillow - run: pip install Pillow==6.2.2 - if: ${{matrix.torchvision == '0.4.1'}} - - name: Install PyTorch - run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html - - name: Install MMCV - run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html - - name: Install unittest dependencies - run: pip install -r requirements/tests.txt - - name: Build and install - run: rm -rf .eggs && pip install -e . - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmedit -m pytest tests/ - coverage xml - coverage report -m + # build_cpu: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # python-version: [3.7] + # torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] + # include: + # - torch: 1.3.0 + # torchvision: 0.4.1 + # - torch: 1.5.0 + # torchvision: 0.6.0 + # - torch: 1.6.0 + # torchvision: 0.7.0 + # - torch: 1.7.0 + # torchvision: 0.8.1 + # - torch: 1.8.0 + # torchvision: 0.9.0 + # - torch: 1.9.0 + # torchvision: 0.10.0 + # steps: + # - uses: actions/checkout@v2 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v2 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: pip install pip --upgrade + # - name: Install Pillow + # run: pip install Pillow==6.2.2 + # if: ${{matrix.torchvision == '0.4.1'}} + # - name: Install PyTorch + # run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html + # - name: Install MMCV + # run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html + # - name: Install unittest dependencies + # run: pip install -r requirements/tests.txt + # - name: Build and install + # run: rm -rf .eggs && pip install -e . + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmedit -m pytest tests/ + # coverage xml + # coverage report -m - build_cuda: - runs-on: ubuntu-latest + # build_cuda101: + # runs-on: ubuntu-latest - env: - CUDA: 10.1.105-1 - CUDA_SHORT: 10.1 - UBUNTU_VERSION: ubuntu1804 - strategy: - matrix: - python-version: [3.7] - torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] - include: - - torch: 1.3.0 - torchvision: 0.4.1 - - torch: 1.5.0 - torchvision: 0.6.0 - - torch: 1.6.0 - torchvision: 0.7.0 - - torch: 1.7.0 - torchvision: 0.8.1 - - torch: 1.7.0 - torchvision: 0.8.1 - python-version: 3.6 - - torch: 1.7.0 - torchvision: 0.8.1 - python-version: 3.8 - - torch: 1.8.0 - torchvision: 0.9.0 + # env: + # CUDA: 10.1.105-1 + # CUDA_SHORT: 10.1 + # UBUNTU_VERSION: ubuntu1804 + # strategy: + # matrix: + # python-version: [3.7] + # torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] + # include: + # - torch: 1.3.0 + # torchvision: 0.4.1 + # - torch: 1.5.0 + # torchvision: 0.6.0 + # - torch: 1.6.0 + # torchvision: 0.7.0 + # - torch: 1.7.0 + # torchvision: 0.8.1 + # - torch: 1.7.0 + # torchvision: 0.8.1 + # python-version: 3.6 + # - torch: 1.7.0 + # torchvision: 0.8.1 + # python-version: 3.8 + # - torch: 1.8.0 + # torchvision: 0.9.0 - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: pip install pip --upgrade - - name: Install CUDA - run: | - export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb - wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} - sudo dpkg -i ${INSTALLER} - wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub - sudo apt-key add 7fa2af80.pub - sudo apt update -qq - sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} - sudo apt clean - export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} - export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} - export PATH=${CUDA_HOME}/bin:${PATH} - - name: Install Pillow - run: pip install Pillow==6.2.2 - if: ${{matrix.torchvision < 0.5}} - - name: Install PyTorch - run: | - if [ ${{matrix.torch}} == '1.3.0' ] - then - pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html - else - pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html - fi - - name: Install MMCV - run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html - - name: Install other dependencies - run: pip install -r requirements.txt - - name: Build and install - run: | - rm -rf .eggs - python setup.py check -m -s - TORCH_CUDA_ARCH_LIST=7.0 pip install . - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmedit -m pytest tests/ - coverage xml - coverage report -m - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.0.10 - with: - file: ./coverage.xml - flags: unittests - env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + # steps: + # - uses: actions/checkout@v2 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v2 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: pip install pip --upgrade + # - name: Install CUDA + # run: | + # export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb + # wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} + # sudo dpkg -i ${INSTALLER} + # wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub + # sudo apt-key add 7fa2af80.pub + # sudo apt update -qq + # sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} + # sudo apt clean + # export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} + # export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} + # export PATH=${CUDA_HOME}/bin:${PATH} + # - name: Install Pillow + # run: pip install Pillow==6.2.2 + # if: ${{matrix.torchvision < 0.5}} + # - name: Install PyTorch + # run: | + # if [ ${{matrix.torch}} == '1.3.0' ] + # then + # pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html + # else + # pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html + # fi + # - name: Install MMCV + # run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html + # - name: Install other dependencies + # run: pip install -r requirements.txt + # - name: Build and install + # run: | + # rm -rf .eggs + # python setup.py check -m -s + # TORCH_CUDA_ARCH_LIST=7.0 pip install . + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmedit -m pytest tests/ + # coverage xml + # coverage report -m + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v1.0.10 + # with: + # file: ./coverage.xml + # flags: unittests + # env_vars: OS,PYTHON + # name: codecov-umbrella + # fail_ci_if_error: false build_cuda102: @@ -196,13 +196,7 @@ jobs: run: pip install Pillow==6.2.2 if: ${{matrix.torchvision < 0.5}} - name: Install PyTorch - run: | - if [ ${{matrix.torch}} == '1.3.0' ] - then - pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html - else - pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html - fi + run: pip install torch==${{matrix.torch}}+cu102 torchvision==${{matrix.torchvision}}+cu102 -f https://download.pytorch.org/whl/torch_stable.html - name: Install MMCV run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html - name: Install other dependencies From d28a93a8c96a2fbe6c97a77af01b7aea3436ba09 Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Thu, 22 Jul 2021 22:42:13 +0800 Subject: [PATCH 6/6] test CI pt1.9 --- .github/workflows/build.yml | 284 ++++++++++++++++++------------------ 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdfd83efa6..c16cb73955 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,152 +8,152 @@ on: pull_request: jobs: - # lint: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Set up Python 3.7 - # uses: actions/setup-python@v2 - # with: - # python-version: 3.7 - # - name: Install pre-commit hook - # run: | - # pip install pre-commit - # pre-commit install - # - name: Linting - # run: pre-commit run --all-files - # - name: Check docstring coverage - # run: | - # pip install interrogate - # interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install pre-commit hook + run: | + pip install pre-commit + pre-commit install + - name: Linting + run: pre-commit run --all-files + - name: Check docstring coverage + run: | + pip install interrogate + interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit - # build_cpu: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # python-version: [3.7] - # torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] - # include: - # - torch: 1.3.0 - # torchvision: 0.4.1 - # - torch: 1.5.0 - # torchvision: 0.6.0 - # - torch: 1.6.0 - # torchvision: 0.7.0 - # - torch: 1.7.0 - # torchvision: 0.8.1 - # - torch: 1.8.0 - # torchvision: 0.9.0 - # - torch: 1.9.0 - # torchvision: 0.10.0 - # steps: - # - uses: actions/checkout@v2 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v2 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Upgrade pip - # run: pip install pip --upgrade - # - name: Install Pillow - # run: pip install Pillow==6.2.2 - # if: ${{matrix.torchvision == '0.4.1'}} - # - name: Install PyTorch - # run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html - # - name: Install MMCV - # run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html - # - name: Install unittest dependencies - # run: pip install -r requirements/tests.txt - # - name: Build and install - # run: rm -rf .eggs && pip install -e . - # - name: Run unittests and generate coverage report - # run: | - # coverage run --branch --source mmedit -m pytest tests/ - # coverage xml - # coverage report -m + build_cpu: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7] + torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0] + include: + - torch: 1.3.0 + torchvision: 0.4.1 + - torch: 1.5.0 + torchvision: 0.6.0 + - torch: 1.6.0 + torchvision: 0.7.0 + - torch: 1.7.0 + torchvision: 0.8.1 + - torch: 1.8.0 + torchvision: 0.9.0 + - torch: 1.9.0 + torchvision: 0.10.0 + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: pip install pip --upgrade + - name: Install Pillow + run: pip install Pillow==6.2.2 + if: ${{matrix.torchvision == '0.4.1'}} + - name: Install PyTorch + run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html + - name: Install MMCV + run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html + - name: Install unittest dependencies + run: pip install -r requirements/tests.txt + - name: Build and install + run: rm -rf .eggs && pip install -e . + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmedit -m pytest tests/ + coverage xml + coverage report -m - # build_cuda101: - # runs-on: ubuntu-latest + build_cuda101: + runs-on: ubuntu-latest - # env: - # CUDA: 10.1.105-1 - # CUDA_SHORT: 10.1 - # UBUNTU_VERSION: ubuntu1804 - # strategy: - # matrix: - # python-version: [3.7] - # torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] - # include: - # - torch: 1.3.0 - # torchvision: 0.4.1 - # - torch: 1.5.0 - # torchvision: 0.6.0 - # - torch: 1.6.0 - # torchvision: 0.7.0 - # - torch: 1.7.0 - # torchvision: 0.8.1 - # - torch: 1.7.0 - # torchvision: 0.8.1 - # python-version: 3.6 - # - torch: 1.7.0 - # torchvision: 0.8.1 - # python-version: 3.8 - # - torch: 1.8.0 - # torchvision: 0.9.0 + env: + CUDA: 10.1.105-1 + CUDA_SHORT: 10.1 + UBUNTU_VERSION: ubuntu1804 + strategy: + matrix: + python-version: [3.7] + torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] + include: + - torch: 1.3.0 + torchvision: 0.4.1 + - torch: 1.5.0 + torchvision: 0.6.0 + - torch: 1.6.0 + torchvision: 0.7.0 + - torch: 1.7.0 + torchvision: 0.8.1 + - torch: 1.7.0 + torchvision: 0.8.1 + python-version: 3.6 + - torch: 1.7.0 + torchvision: 0.8.1 + python-version: 3.8 + - torch: 1.8.0 + torchvision: 0.9.0 - # steps: - # - uses: actions/checkout@v2 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v2 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Upgrade pip - # run: pip install pip --upgrade - # - name: Install CUDA - # run: | - # export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb - # wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} - # sudo dpkg -i ${INSTALLER} - # wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub - # sudo apt-key add 7fa2af80.pub - # sudo apt update -qq - # sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} - # sudo apt clean - # export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} - # export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} - # export PATH=${CUDA_HOME}/bin:${PATH} - # - name: Install Pillow - # run: pip install Pillow==6.2.2 - # if: ${{matrix.torchvision < 0.5}} - # - name: Install PyTorch - # run: | - # if [ ${{matrix.torch}} == '1.3.0' ] - # then - # pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html - # else - # pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html - # fi - # - name: Install MMCV - # run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html - # - name: Install other dependencies - # run: pip install -r requirements.txt - # - name: Build and install - # run: | - # rm -rf .eggs - # python setup.py check -m -s - # TORCH_CUDA_ARCH_LIST=7.0 pip install . - # - name: Run unittests and generate coverage report - # run: | - # coverage run --branch --source mmedit -m pytest tests/ - # coverage xml - # coverage report -m - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v1.0.10 - # with: - # file: ./coverage.xml - # flags: unittests - # env_vars: OS,PYTHON - # name: codecov-umbrella - # fail_ci_if_error: false + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: pip install pip --upgrade + - name: Install CUDA + run: | + export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb + wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} + sudo dpkg -i ${INSTALLER} + wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub + sudo apt-key add 7fa2af80.pub + sudo apt update -qq + sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} + sudo apt clean + export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} + export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} + export PATH=${CUDA_HOME}/bin:${PATH} + - name: Install Pillow + run: pip install Pillow==6.2.2 + if: ${{matrix.torchvision < 0.5}} + - name: Install PyTorch + run: | + if [ ${{matrix.torch}} == '1.3.0' ] + then + pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html + else + pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html + fi + - name: Install MMCV + run: pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html + - name: Install other dependencies + run: pip install -r requirements.txt + - name: Build and install + run: | + rm -rf .eggs + python setup.py check -m -s + TORCH_CUDA_ARCH_LIST=7.0 pip install . + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmedit -m pytest tests/ + coverage xml + coverage report -m + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.10 + with: + file: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false build_cuda102: