Unverified Commit d429df1a authored by Zaida Zhou's avatar Zaida Zhou Committed by GitHub
Browse files

[Refactor] Refactor the pytorch and cuda combination for testing in CI (#2693)

* Refactor CI

* Upload coverage to Codecov

* update

* update

* update

* update

* test

* test

* fix typo

* fix

* fix

* fix

* fix circleci

* fix circleci

* revert comments

* add verpose

* install cuda

install cuda

install cuda

install cuda

install cuda

install cuda

install cuda

fix env

fix env

fix env

fix env

fix

fix

fix

fix

fix

fix

fix

fix

fix

fix

fix

fix

fix

fix circleci

fix circleci

remove cuda11.1 test from windows

update ci

update ci

update ci

update ci

update ci

update ci

update ci

update ci

* do not test python3.11

* revert comments
parent 1db3967e
...@@ -24,7 +24,7 @@ workflows: ...@@ -24,7 +24,7 @@ workflows:
requirements/.* lint_only false requirements/.* lint_only false
tests/.* lint_only false tests/.* lint_only false
.circleci/.* lint_only false .circleci/.* lint_only false
base-revision: 2.x base-revision: main
# this is the path of the configuration we should trigger once # this is the path of the configuration we should trigger once
# path filtering and pipeline parameter value updates are # path filtering and pipeline parameter value updates are
# complete. In this case, we are using the parent dynamic # complete. In this case, we are using the parent dynamic
......
...@@ -158,7 +158,7 @@ jobs: ...@@ -158,7 +158,7 @@ jobs:
name: Install unit tests dependencies name: Install unit tests dependencies
command: pip install -r requirements/test.txt command: pip install -r requirements/test.txt
- run: - run:
name: Run unittests name: Run unit tests
command: | command: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
...@@ -169,7 +169,7 @@ jobs: ...@@ -169,7 +169,7 @@ jobs:
type: string type: string
cuda: cuda:
type: enum type: enum
enum: ["10.1", "10.2", "11.1"] enum: ["10.1", "10.2", "11.1", "11.7"]
cudnn: cudnn:
type: integer type: integer
default: 7 default: 7
...@@ -187,6 +187,9 @@ jobs: ...@@ -187,6 +187,9 @@ jobs:
- run: - run:
name: Install MMEngine from main branch name: Install MMEngine from main branch
command: docker exec mmcv pip install git+https://github.com/open-mmlab/mmengine.git@main command: docker exec mmcv pip install git+https://github.com/open-mmlab/mmengine.git@main
- run:
name: Install ninja to speed the compilation
command: docker exec mmcv pip install ninja
- run: - run:
name: Build MMCV from source name: Build MMCV from source
command: docker exec mmcv pip install -e . -v command: docker exec mmcv pip install -e . -v
...@@ -194,8 +197,9 @@ jobs: ...@@ -194,8 +197,9 @@ jobs:
name: Install unit tests dependencies name: Install unit tests dependencies
command: docker exec mmcv pip install -r requirements/test.txt command: docker exec mmcv pip install -r requirements/test.txt
- run: - run:
name: Run unittests name: Run unit tests
command: docker exec mmcv python -m pytest tests/ command: docker exec mmcv python -m pytest tests/
workflows: workflows:
pr_stage_lint: pr_stage_lint:
when: << pipeline.parameters.lint_only >> when: << pipeline.parameters.lint_only >>
...@@ -205,7 +209,7 @@ workflows: ...@@ -205,7 +209,7 @@ workflows:
filters: filters:
branches: branches:
ignore: ignore:
- 2.x - main
pr_stage_test: pr_stage_test:
when: when:
not: not:
...@@ -216,43 +220,50 @@ workflows: ...@@ -216,43 +220,50 @@ workflows:
filters: filters:
branches: branches:
ignore: ignore:
- 2.x - main
- build_without_torch: - build_without_torch:
name: build_without_torch name: build_without_torch
requires: requires:
- lint - lint
- build_without_ops: - build_without_ops:
name: build_without_ops name: build_without_ops
torch: 1.6.0 torch: 1.8.1
torchvision: 0.7.0 torchvision: 0.9.1
requires: requires:
- build_without_torch - build_without_torch
- build_cpu: - build_cpu:
name: minimum_version_cpu name: minimum_version_cpu
torch: 1.6.0 torch: 1.8.1
torchvision: 0.7.0 torchvision: 0.9.1
python: 3.7.4 python: 3.7.4
requires: requires:
- build_without_ops - build_without_ops
- build_cpu: - build_cpu:
name: maximum_version_cpu name: maximum_version_cpu
torch: 1.13.0 torch: 2.0.0
torchvision: 0.14.0 torchvision: 0.15.1
python: 3.9.0 python: 3.9.0
requires: requires:
- minimum_version_cpu - minimum_version_cpu
- hold: - hold_cuda_test:
type: approval type: approval
requires:
- maximum_version_cpu
- build_cuda: - build_cuda:
name: mainstream_version_gpu name: minimum_version_gpu
torch: 1.8.1 torch: 1.8.1
# Use double quotation mark to explicitly specify its type # Use double quotation mark to explicitly specify its type
# as string instead of number # as string instead of number
cuda: "10.2" cuda: "10.2"
requires: requires:
- hold - hold_cuda_test
- build_cuda:
name: maximum_version_gpu
torch: 2.0.0
# Use double quotation mark to explicitly specify its type
# as string instead of number
cuda: "11.7"
cudnn: 8
requires:
- hold_cuda_test
merge_stage_test: merge_stage_test:
when: when:
not: not:
...@@ -260,11 +271,22 @@ workflows: ...@@ -260,11 +271,22 @@ workflows:
jobs: jobs:
- build_cuda: - build_cuda:
name: minimum_version_gpu name: minimum_version_gpu
torch: 1.6.0 torch: 1.8.1
# Use double quotation mark to explicitly specify its type
# as string instead of number
cuda: "10.2"
filters:
branches:
only:
- main
- build_cuda:
name: maximum_version_gpu
torch: 2.0.0
# Use double quotation mark to explicitly specify its type # Use double quotation mark to explicitly specify its type
# as string instead of number # as string instead of number
cuda: "10.1" cuda: "11.7"
cudnn: 8
filters: filters:
branches: branches:
only: only:
- 2.x - main
...@@ -9,7 +9,7 @@ concurrency: ...@@ -9,7 +9,7 @@ concurrency:
jobs: jobs:
build_macos10_wheel: build_macos10_wheel:
runs-on: macos-10.15 runs-on: macos-10.15
# if: contains(github.event.head_commit.message, 'Bump version to') if: contains(github.event.head_commit.message, 'Bump version to')
strategy: strategy:
matrix: matrix:
torch: [1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.13.0, 2.0.0] torch: [1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.13.0, 2.0.0]
......
...@@ -18,7 +18,7 @@ env: ...@@ -18,7 +18,7 @@ env:
jobs: jobs:
build_parrots: build_parrots:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
container: container:
image: ghcr.io/cokedong/parrots:pat0.21.0a0_cuda11 image: ghcr.io/cokedong/parrots:pat0.21.0a0_cuda11
credentials: credentials:
......
...@@ -8,7 +8,7 @@ concurrency: ...@@ -8,7 +8,7 @@ concurrency:
jobs: jobs:
lint: lint:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python 3.7
......
...@@ -14,7 +14,7 @@ on: ...@@ -14,7 +14,7 @@ on:
- ".pre-commit-config.yaml" - ".pre-commit-config.yaml"
- ".pre-commit-config-zh-cn.yaml" - ".pre-commit-config-zh-cn.yaml"
branches: branches:
- 2.x - main
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
...@@ -22,7 +22,7 @@ concurrency: ...@@ -22,7 +22,7 @@ concurrency:
jobs: jobs:
build_without_torch: build_without_torch:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
env: env:
MMCV_WITH_OPS: 0 MMCV_WITH_OPS: 0
strategy: strategy:
...@@ -45,7 +45,7 @@ jobs: ...@@ -45,7 +45,7 @@ jobs:
- name: Run unit tests - name: Run unit tests
run: pytest tests/test_image tests/test_transforms tests/test_video tests/test_arraymisc.py tests/test_visualization.py tests/test_utils/test_env.py --ignore=tests/test_image/test_io.py run: pytest tests/test_image tests/test_transforms tests/test_video tests/test_arraymisc.py tests/test_visualization.py tests/test_utils/test_env.py --ignore=tests/test_image/test_io.py
build_without_ops: build_without_ops:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
env: env:
MMCV_WITH_OPS: 0 MMCV_WITH_OPS: 0
strategy: strategy:
...@@ -75,17 +75,17 @@ jobs: ...@@ -75,17 +75,17 @@ jobs:
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests --ignore=tests/test_ops run: pytest tests --ignore=tests/test_ops
build_cpu_py: build_cpu_py:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
python-version: [3.8, 3.9] python-version: [3.8, 3.9, '3.10']
torch: [1.8.1] torch: [1.13.0]
include: include:
- torch: 1.8.1 - torch: 1.13.0
torchvision: 0.9.1 torchvision: 0.14.0
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -101,27 +101,23 @@ jobs: ...@@ -101,27 +101,23 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m coverage report -m
build_cpu_pt: build_cpu_pt:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
torch: [1.6.0, 1.7.1, 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.12.0, 1.13.0] torch: [1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 2.0.0]
include: include:
- torch: 1.6.0
torchvision: 0.7.0
- torch: 1.7.1
torchvision: 0.8.2
- torch: 1.8.1 - torch: 1.8.1
torchvision: 0.9.1 torchvision: 0.9.1
- torch: 1.9.1 - torch: 1.9.1
...@@ -134,6 +130,12 @@ jobs: ...@@ -134,6 +130,12 @@ jobs:
torchvision: 0.13.0 torchvision: 0.13.0
- torch: 1.13.0 - torch: 1.13.0
torchvision: 0.14.0 torchvision: 0.14.0
- torch: 2.0.0
torchvision: 0.15.1
python-version: 3.8
exclude:
- torch: 2.0.0
python-version: 3.7
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -149,19 +151,19 @@ jobs: ...@@ -149,19 +151,19 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m coverage report -m
# Only upload coverage report for python3.7 && pytorch1.8.1 cpu # Only upload coverage report for python3.7 && pytorch1.8.1 cpu
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
if: ${{matrix.torch == '1.8.1' && matrix.python-version == '3.7'}} if: ${{matrix.torch == '1.8.1' && matrix.python-version == '3.8'}}
uses: codecov/codecov-action@v1.0.14 uses: codecov/codecov-action@v1.0.14
with: with:
file: ./coverage.xml file: ./coverage.xml
...@@ -170,12 +172,12 @@ jobs: ...@@ -170,12 +172,12 @@ jobs:
name: codecov-umbrella name: codecov-umbrella
fail_ci_if_error: false fail_ci_if_error: false
build_cu102: build_cu102:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
container: container:
image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel
strategy: strategy:
matrix: matrix:
python-version: [3.8] python-version: [3.7]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -193,18 +195,52 @@ jobs: ...@@ -193,18 +195,52 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: |
coverage run --branch --source mmcv -m pytest tests/
coverage xml
coverage report -m
build_cu111:
runs-on: ubuntu-22.04
container:
image: pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel
strategy:
matrix:
python-version: [3.7]
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: Fetch GPG keys
run: |
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
- name: Install system dependencies
run: apt-get update && apt-get install -y git ffmpeg libturbojpeg
- name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation
run: pip install ninja psutil
- name: Build MMCV from source
run: pip install -e . -v
- name: Install unit tests dependencies
run: pip install -r requirements/test.txt
- name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m coverage report -m
build_cu116: build_cu116:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
container: container:
image: pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel image: pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel
strategy: strategy:
...@@ -227,30 +263,29 @@ jobs: ...@@ -227,30 +263,29 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests coverage run --branch --source mmcv -m pytest tests
coverage xml coverage xml
coverage report -m coverage report -m
build_windows_without_ops: build_windows_without_ops:
runs-on: ${{ matrix.os }} runs-on: windows-2019
env: env:
MMCV_WITH_OPS: 0 MMCV_WITH_OPS: 0
strategy: strategy:
matrix: matrix:
os: [windows-2019]
python-version: [3.7] python-version: [3.7]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: ${{ matrix.python-version }}
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install pip --upgrade run: python -m pip install pip --upgrade
- name: Install PyTorch - name: Install PyTorch
...@@ -258,26 +293,25 @@ jobs: ...@@ -258,26 +293,25 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests --ignore=tests/test_ops --ignore tests/test_image/test_io.py run: pytest tests --ignore=tests/test_ops --ignore tests/test_image/test_io.py
build_windows: build_windows:
runs-on: ${{ matrix.os }} runs-on: windows-2019
strategy: strategy:
matrix: matrix:
os: [windows-2019] torch: [1.8.1, 2.0.0]
python: [3.7]
torch: [1.8.1, 1.10.1]
include: include:
- torch: 1.8.1 - torch: 1.8.1
torchvision: 0.9.1 torchvision: 0.9.1
- torch: 1.10.1 python-version: 3.7
torchvision: 0.11.2 - torch: 2.0.0
platform: [cpu, cu111] torchvision: 0.15.1
python-version: 3.8
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -287,33 +321,32 @@ jobs: ...@@ -287,33 +321,32 @@ jobs:
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install pip --upgrade run: python -m pip install pip --upgrade
- name: Install PyTorch - name: Install PyTorch
run: pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests/ --ignore tests/test_image/test_io.py run: pytest tests/ --ignore tests/test_image/test_io.py
build_macos: build_macos:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
matrix: matrix:
python-version: [3.7] torch: [1.8.1, 2.0.0]
torch: [1.6.0, 1.8.1, 1.13.0]
include: include:
- torch: 1.6.0
torchvision: 0.7.0
- torch: 1.8.1 - torch: 1.8.1
torchvision: 0.9.1 torchvision: 0.9.1
- torch: 1.13.0 python-version: 3.7
torchvision: 0.14.0 - torch: 2.0.0
torchvision: 0.15.1
python-version: 3.8
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
...@@ -326,10 +359,10 @@ jobs: ...@@ -326,10 +359,10 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests/ run: pytest tests/
...@@ -19,40 +19,40 @@ concurrency: ...@@ -19,40 +19,40 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build_cpu: build_cu102:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
container:
image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
include:
- torch: 1.8.1
torchvision: 0.9.1
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libturbojpeg
- name: Upgrade pip - name: Upgrade pip
run: pip install pip --upgrade run: pip install pip --upgrade
- name: Install PyTorch - name: Fetch GPG keys
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html run: |
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
- name: Install system dependencies
run: apt-get update && apt-get install -y git ffmpeg libturbojpeg
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m coverage report -m
# Upload coverage report for python3.7 && pytorch1.8.1 cpu
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.14 uses: codecov/codecov-action@v1.0.14
with: with:
...@@ -61,13 +61,13 @@ jobs: ...@@ -61,13 +61,13 @@ jobs:
env_vars: OS,PYTHON env_vars: OS,PYTHON
name: codecov-umbrella name: codecov-umbrella
fail_ci_if_error: false fail_ci_if_error: false
build_cu102: build_cu111:
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
container: container:
image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel image: pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel
strategy: strategy:
matrix: matrix:
python-version: [3.8] python-version: [3.7]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -85,30 +85,29 @@ jobs: ...@@ -85,30 +85,29 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests and generate coverage report - name: Run unit tests and generate coverage report
run: | run: |
coverage run --branch --source mmcv -m pytest tests/ coverage run --branch --source mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m coverage report -m
build_windows_without_ops: build_windows_without_ops:
runs-on: ${{ matrix.os }} runs-on: windows-2019
env: env:
MMCV_WITH_OPS: 0 MMCV_WITH_OPS: 0
strategy: strategy:
matrix: matrix:
os: [windows-2019]
python-version: [3.7] python-version: [3.7]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: ${{ matrix.python-version }}
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install pip --upgrade run: python -m pip install pip --upgrade
- name: Install PyTorch - name: Install PyTorch
...@@ -116,20 +115,25 @@ jobs: ...@@ -116,20 +115,25 @@ jobs:
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests --ignore=tests/test_ops --ignore tests/test_image/test_io.py run: pytest tests --ignore=tests/test_ops --ignore tests/test_image/test_io.py
build_windows: build_windows:
runs-on: ${{ matrix.os }} runs-on: windows-2019
strategy: strategy:
matrix: matrix:
os: [windows-2019] torch: [1.8.1, 2.0.0]
python: [3.7] include:
platform: [cpu, cu111] - torch: 1.8.1
torchvision: 0.9.1
python-version: 3.7
- torch: 2.0.0
torchvision: 0.15.1
python-version: 3.8
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -139,25 +143,32 @@ jobs: ...@@ -139,25 +143,32 @@ jobs:
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install pip --upgrade run: python -m pip install pip --upgrade
- name: Install PyTorch - name: Install PyTorch
run: pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests/ --ignore tests/test_image/test_io.py run: pytest tests/ --ignore tests/test_image/test_io.py
build_macos: build_macos:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
matrix: matrix:
python-version: [3.7] torch: [1.8.1, 2.0.0]
include:
- torch: 1.8.1
torchvision: 0.9.1
python-version: 3.7
- torch: 2.0.0
torchvision: 0.15.1
python-version: 3.8
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
...@@ -166,14 +177,14 @@ jobs: ...@@ -166,14 +177,14 @@ jobs:
- name: Upgrade pip - name: Upgrade pip
run: pip install pip --upgrade run: pip install pip --upgrade
- name: Install PyTorch - name: Install PyTorch
run: pip install torch==1.8.1 torchvision==0.9.1 run: pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }}
- name: Install MMEngine from main branch - name: Install MMEngine from main branch
run: pip install git+https://github.com/open-mmlab/mmengine.git@main run: pip install git+https://github.com/open-mmlab/mmengine.git@main
- name: Install ninja to speed the compilation - name: Install ninja to speed the compilation
run: pip install ninja run: pip install ninja psutil
- name: Build MMCV from source - name: Build MMCV from source
run: pip install -e . -v run: pip install -e . -v
- name: Install unit tests dependencies - name: Install unit tests dependencies
run: pip install -r requirements/test.txt run: pip install -r requirements/test.txt
- name: Run unittests - name: Run unit tests
run: pytest tests/ run: pytest tests/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment