Add pytorch 1.6 to CI (#476)

* add pytorch 1.6 to CI

* fix typo

* fix ci error

Co-authored-by: Cao Yuhang <yhcao6@gmail.com>
pull/480/head
Kai Chen 2020-08-09 21:56:15 +08:00 committed by GitHub
parent 56e71a718b
commit cac22f8cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 38 deletions

View File

@ -31,6 +31,30 @@ jobs:
extensions: h,c,cpp,hpp,cu,cuh extensions: h,c,cpp,hpp,cu,cuh
style: google style: google
build_without_torch:
runs-on: ubuntu-latest
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: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libturbojpeg
- name: Install unittest dependencies
run: pip install pytest coverage lmdb PyTurboJPEG
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Install Pillow
run: pip install Pillow
- name: Run unittests and generate coverage report
run: |
pytest tests/ --ignore=tests/test_runner --ignore=tests/test_optimizer.py --ignore=tests/test_cnn --ignore=tests/test_parallel.py --ignore=tests/test_ops --ignore=tests/test_load_model_zoo.py --ignore=tests/test_logging.py --ignore=tests/test_image/test_io.py --ignore=tests/test_registry.py --ignore=tests/test_fp16.py
build_without_ops: build_without_ops:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
@ -38,10 +62,10 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
torch: [1.5.1] torch: [1.6.0]
include: include:
- torch: 1.5.1 - torch: 1.6.0
torchvision: 0.6.1 torchvision: 0.7.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 }}
@ -67,10 +91,16 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
torch: [1.4.0] torch: [1.3.1, 1.4.0, 1.5.1, 1.6.0]
include: include:
- torch: 1.4.0 - torch: 1.3.1
torchvision: 0.4.2 torchvision: 0.4.2
- torch: 1.4.0
torchvision: 0.5.0
- torch: 1.5.1
torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.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 }}
@ -104,16 +134,21 @@ jobs:
MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61 MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61
strategy: strategy:
matrix: matrix:
python-version: [3.6, 3.7] python-version: [3.7]
torch: [1.3.1, 1.5.1+cu101] torch: [1.3.1, 1.5.1+cu101, 1.6.0+cu101]
include: include:
- torch: 1.3.1 - torch: 1.3.1
torchvision: 0.4.2 torchvision: 0.4.2
- torch: 1.5.1+cu101 - torch: 1.5.1+cu101
torchvision: 0.6.1+cu101 torchvision: 0.6.1+cu101
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
- python-version: 3.6
torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
- python-version: 3.8 - python-version: 3.8
torch: 1.5.1+cu101 torch: 1.6.0+cu101
torchvision: 0.6.1+cu101 torchvision: 0.7.0+cu101
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -162,40 +197,18 @@ jobs:
name: codecov-umbrella name: codecov-umbrella
fail_ci_if_error: false fail_ci_if_error: false
build_no_torch:
runs-on: ubuntu-latest
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: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libturbojpeg
- name: Install unittest dependencies
run: pip install pytest coverage lmdb PyTurboJPEG
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Install Pillow
run: pip install Pillow
- name: Run unittests and generate coverage report
run: |
pytest tests/ --ignore=tests/test_runner --ignore=tests/test_optimizer.py --ignore=tests/test_cnn --ignore=tests/test_parallel.py --ignore=tests/test_ops --ignore=tests/test_load_model_zoo.py --ignore=tests/test_logging.py --ignore=tests/test_image/test_io.py --ignore=tests/test_registry.py --ignore=tests/test_fp16.py
build_macos: build_macos:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
matrix: matrix:
torch: [1.5.1, 1.3.1] torch: [1.3.1, 1.5.1, 1.6.0]
include: include:
- torch: 1.3.1 - torch: 1.3.1
torchvision: 0.4.2 torchvision: 0.4.2
- torch: 1.5.1 - torch: 1.5.1
torchvision: 0.6.1 torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.0
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python 3.7

View File

@ -122,13 +122,13 @@ You can either
If you are on macOS, add the following environment variables before the installing command. If you are on macOS, add the following environment variables before the installing command.
```bash ```bash
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' CC=clang CXX=clang++ CFLAGS='-stdlib=libc++'
``` ```
e.g., e.g.,
```bash ```bash
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e . CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .
``` ```
Note: If you would like to use `opencv-python-headless` instead of `opencv-python`, Note: If you would like to use `opencv-python-headless` instead of `opencv-python`,

View File

@ -9,8 +9,12 @@ from mmcv.parallel.distributed_deprecated import \
MMDistributedDataParallel as DeprecatedMMDDP MMDistributedDataParallel as DeprecatedMMDDP
@patch('torch.distributed._broadcast_coalesced', MagicMock) def mock(*args, **kwargs):
@patch('torch.distributed.broadcast', MagicMock) pass
@patch('torch.distributed._broadcast_coalesced', mock)
@patch('torch.distributed.broadcast', mock)
@patch('torch.nn.parallel.DistributedDataParallel._ddp_init_helper', MagicMock) @patch('torch.nn.parallel.DistributedDataParallel._ddp_init_helper', MagicMock)
def test_is_module_wrapper(): def test_is_module_wrapper():