Skip to content

Commit

Permalink
[Enhancement] Upgrade CI for PyTorch1.9 (#115)
Browse files Browse the repository at this point in the history
* fix build.yml

* Upgrade CI for PyTorch1.9

Co-authored-by: yangyifei <PJLAB\yangyifei@shai14001042l.pjlab.org>
  • Loading branch information
plyfager and yangyifei committed Sep 17, 2021
1 parent 284a0a6 commit 9e28c25
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,43 @@ jobs:
runs-on: ubuntu-18.04

env:
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
UBUNTU_VERSION: ubuntu1804
strategy:
matrix:
python-version: [3.7]
torch: [1.5.1+cu101, 1.7.0+cu101, 1.8.0+cu101]
torch: [1.5.1+cu101, 1.7.0+cu101, 1.8.0+cu101, 1.9.0+cu102]
include:
- torch: 1.5.1+cu101
torch_version: torch1.5.1
torchvision: 0.6.1+cu101
mmcv: "latest+torch1.5.0+cu101"
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
- torch: 1.7.0+cu101
torch_version: torch1.7.0
torchvision: 0.8.1+cu101
mmcv: "latest+torch1.7.0+cu101"
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
- torch: 1.8.0+cu101
torch_version: torch1.8.0
torchvision: 0.9.0+cu101
mmcv: "latest+torch1.8.0+cu101"
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
- torch: 1.8.0+cu101
torch_version: torch1.8.0
torchvision: 0.9.0+cu101
mmcv: "latest+torch1.8.0+cu101"
python-version: 3.9
CUDA: 10.1.105-1
CUDA_SHORT: 10.1
- torch: 1.9.0+cu102
torch_version: torch1.9.0
torchvision: 0.10.0+cu102
mmcv: "latest+torch1.9.0+cu102"
CUDA: 10.2.89-1
CUDA_SHORT: 10-2

steps:
- uses: actions/checkout@v2
Expand All @@ -60,26 +72,29 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install CUDA
run: |
export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb
export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${{matrix.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 install -y cuda-${{matrix.CUDA_SHORT}} cuda-cufft-dev-${{matrix.CUDA_SHORT}}
sudo apt clean
export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
export CUDA_HOME=/usr/local/cuda-${{matrix.CUDA_SHORT}}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH}
- name: Upgrade pip
run: pip install pip --upgrade
- name: Install Pillow
run: pip install Pillow==6.2.2
if: ${{matrix.torchvision < 0.5}}
- name: Install PyTorch
run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install mmgen dependencies
run: |
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/${{matrix.torch_version}}/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/${CUDA_SHORT/-/}/${{matrix.torch_version}}/index.html
pip install -r requirements.txt
python -c 'import mmcv; print(mmcv.__version__)'
- name: Build and install
run: |
rm -rf .eggs
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def make_cuda_ext(name, module, sources, sources_cuda=[]):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
url='https://github.com/open-mmlab/mmgen',
author='MMGeneration Contributors',
Expand Down

0 comments on commit 9e28c25

Please sign in to comment.