Skip to content

Commit

Permalink
[Enhancement] Use docker to accelerate CI (#973)
Browse files Browse the repository at this point in the history
* Using docker to skip CUDA installation in CI

* use docker image in workflows/build
* add cu102 and torch1.9.0 test
* remove torch1.3.0 from CI

* fix python3.9-dev installation

* remove sudo

* update turbojpeg installation

* remove sudo

* fix onnx-runtime dependency installation

* remove pip installation from CI

* fix mmcv index url

* fix non-ascii character in macaque.py to avoid config parsing error
  • Loading branch information
ly015 authored Oct 19, 2021
1 parent daf8082 commit a0d513b
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 62 deletions.
134 changes: 77 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ jobs:
strategy:
matrix:
python-version: [3.7]
torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0]
torch: [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
Expand Down Expand Up @@ -74,20 +72,15 @@ jobs:
coverage xml
coverage report -m
build_cuda:
build_cuda101:
runs-on: ubuntu-18.04

env:
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
UBUNTU_VERSION: ubuntu1804
container:
image: pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel
strategy:
matrix:
python-version: [3.7]
torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0]
torch: [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
Expand All @@ -96,78 +89,105 @@ jobs:
torchvision: 0.8.1
- torch: 1.8.0
torchvision: 0.9.0
- python-version: 3.6
torch: 1.7.0
torchvision: 0.8.1
- python-version: 3.8
torch: 1.7.0
torchvision: 0.8.1
- python-version: 3.8
torch: 1.8.0
torchvision: 0.9.0
- python-version: 3.9
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
- name: Install system dependencies
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}
sudo apt-get install -y ninja-build
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg python${{matrix.python-version}}-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Install dependencies for compiling onnx when python=3.9
run: pip install protobuf && sudo apt-get install libprotobuf-dev protobuf-compiler
run: python -m pip install protobuf && apt-get install -y libprotobuf-dev protobuf-compiler
if: ${{matrix.python-version == '3.9'}}
- name: Install Pillow
run: pip install Pillow==6.2.2
run: python -m pip install Pillow==6.2.2
if: ${{matrix.torchvision < 0.5}}
- name: Install TurboJpeg lib
run: sudo apt-get install -y libturbojpeg
- name: Install PyTorch
run: python -m pip install torch==${{matrix.torch}}+cu101 torchvision==${{matrix.torchvision}}+cu101 -f https://download.pytorch.org/whl/torch_stable.html
- name: Install mmpose dependencies
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
python -V
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/${{matrix.torch}}/index.html
python -m pip install -r requirements.txt
python -c 'import mmcv; print(mmcv.__version__)'
- name: Build and install
run: |
rm -rf .eggs
python setup.py check -m -s
TORCH_CUDA_ARCH_LIST=7.0 python -m pip install .
- name: Run unittests and generate coverage report
run: |
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch}}/index.html
coverage run --branch --source mmpose -m pytest tests/
coverage xml
coverage report -m
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false

build_cuda102:
runs-on: ubuntu-18.04
container:
image: pytorch/pytorch:1.9.0-cuda10.2-cudnn7-devel
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9-dev]
torch: [1.9.0]
include:
- 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: Install python-dev
run: apt-get update && apt-get install -y python${{matrix.python-version}}-dev
if: ${{matrix.python-version != '3.9-dev'}}
- name: Install system dependencies
run: |
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Install dependencies for compiling onnx when python=3.9
run: python -m pip install protobuf && apt-get update && apt-get -y install libprotobuf-dev protobuf-compiler cmake
if: ${{matrix.python-version == '3.9-dev'}}
- name: Install Pillow
run: python -m pip install Pillow==6.2.2
if: ${{matrix.torchvision < 0.5}}
- name: Install PyTorch
run: python -m pip install torch==${{matrix.torch}}+cu102 torchvision==${{matrix.torchvision}}+cu102 -f https://download.pytorch.org/whl/torch_stable.html
- name: Install mmpose dependencies
run: |
python -V
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/${{matrix.torch}}/index.html
python -m pip install -r requirements.txt
python -c 'import mmcv; print(mmcv.__version__)'
- 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 .
TORCH_CUDA_ARCH_LIST=7.0 python -m pip install .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmpose -m pytest tests/
coverage xml
coverage report -m
- name: Upload coverage to Codecov
if: ${{matrix.torch == '1.6.0+cu101' && matrix.python-version == '3.7'}}
uses: codecov/[email protected]
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ English | [简体中文](README_CN.md)
MMPose is an open-source toolbox for pose estimation based on PyTorch.
It is a part of the [OpenMMLab project](https://github.com/open-mmlab).

The master branch works with **PyTorch 1.3+**.
Please kindly note that MMPose will switch to **PyTorch 1.5+** from Oct. 2021. The compatibility to earlier versions of PyTorch will no longer be guaranteed.
The master branch works with **PyTorch 1.5+**.

https://user-images.githubusercontent.com/15977946/124654387-0fd3c500-ded1-11eb-84f6-24eeddbf4d91.mp4

Expand Down
3 changes: 1 addition & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

MMPose 是一款基于 PyTorch 的姿态分析的开源工具箱,是 [OpenMMLab](http://openmmlab.org/) 项目的成员之一。

主分支代码目前支持 **PyTorch 1.3 以上**的版本。
请注意,MMPose将在2021年10月后仅支持**PyTorch 1.5 以上**的版本,并不再保证对较早版本的兼容性。
主分支代码目前支持 **PyTorch 1.5 以上**的版本。

https://user-images.githubusercontent.com/15977946/124654387-0fd3c500-ded1-11eb-84f6-24eeddbf4d91.mp4

Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/macaque.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'Negrete, Salvador and Nishimaru, Hiroshi and '
'Nishijo, Hisao and Takada, Masahiko and '
'Go, Yasuhiro and Inoue, Ken-ichi and Shibata, Tomohiro',
title='MacaquePose: A novel in the wildmacaque monkey pose dataset '
title='MacaquePose: A novel "in the wild" macaque monkey pose dataset '
'for markerless motion capture',
container='bioRxiv',
year='2020',
Expand Down

0 comments on commit a0d513b

Please sign in to comment.