[workflow] updated pytorch compatibility test (#1311)

This commit is contained in:
Frank Lee 2022-07-14 16:45:17 +08:00 committed by GitHub
parent 9f10524313
commit c9c37dcc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,18 +3,14 @@ name: Compatibility Test
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: torch_version:
type: choice type: string
description: version for testing description: torch version, separated by comma
default: 'all' required: true
cuda_version:
type: string
description: cuda version, separated by comma
required: true required: true
options:
- all
- pytorch-cuda:1.9.0-11.1.1 # python 3.8
- pytorch-cuda:1.8.1-11.1.1 # python 3.8
- pytorch-cuda:1.7.1-11.0.3 # python 3.8
- pytorch-cuda:1.6.0-10.2 # python 3.6
jobs: jobs:
matrix_preparation: matrix_preparation:
@ -24,12 +20,25 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
steps: steps:
- id: set-matrix - id: set-matrix
env:
TORCH_VERSIONS: ${{ inputs.torch_version }}
CUDA_VERSIONS: ${{ inputs.cuda_version }}
run: | run: |
[ "${{github.event.inputs.version}}" != "" ] && matrix="[\"frankleeeee/${{github.event.inputs.version}}\"]" IFS=','
[ "${{github.event.inputs.version}}" == "" ] || [ "${{github.event.inputs.version}}" == "all" ] && \ DOCKER_IMAGE=()
matrix="[\"frankleeeee/pytorch-cuda:1.9.0-11.1.1\", \"frankleeeee/pytorch-cuda:1.8.1-11.1.1\", \"frankleeeee/pytorch-cuda:1.7.1-11.0.3\", \"frankleeeee/pytorch-cuda:1.6.0-10.2\"]"
echo $matrix for tv in $TORCH_VERSIONS
echo "::set-output name=matrix::{\"container\":$(echo $matrix)}" do
for cv in $CUDA_VERSIONS
do
DOCKER_IMAGE+=("\"hpcaitech/pytorch-cuda:${tv}-${cv}\"")
done
done
container=$( IFS=',' ; echo "${DOCKER_IMAGE[*]}" )
container="[${container}]"
echo "$container"
echo "::set-output name=matrix::{\"container\":$(echo "$container")}"
build: build:
name: Test for PyTorch Compatibility name: Test for PyTorch Compatibility
@ -46,14 +55,13 @@ jobs:
steps: steps:
- name: Install dependencies - name: Install dependencies
run: | run: |
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -U pip setuptools wheel --user pip install -U pip setuptools wheel --user
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Colossal-AI - name: Install Colossal-AI
run: | run: |
pip install -r requirements/requirements.txt pip install -r requirements/requirements.txt
pip install -r requirements/requirements-test.txt
pip install -v --no-cache-dir . pip install -v --no-cache-dir .
pip install -r requirements/requirements-test.txt
- name: Unit Testing - name: Unit Testing
run: | run: |
PYTHONPATH=$PWD pytest tests PYTHONPATH=$PWD pytest tests