Windows support #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI CD | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
outputs: | |
image-tag: ${{ steps.get-tag.outputs.image-tag }} | |
steps: | |
- name: Get Tag | |
id: get-tag | |
run: | | |
if [[ $TAG == main ]] || [[ $TAG =~ v[0-9] ]]; then | |
echo "::set-output name=image-tag::-$TAG" | |
else | |
echo "::set-output name=image-tag::" | |
fi | |
env: | |
TAG: ${{ github.ref_name }} | |
build-images: | |
name: Build Images | |
needs: setup | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', 3.11] | |
pytorch-version: ['1.10', 1.11, 1.12, 1.13] | |
cuda-version: [10.2, 11.3, 11.6, 11.7] | |
include: | |
- cuda-version: 10.2 | |
cuda-arch-list: "6.0 6.1 6.2 7.0 7.2 7.5+PTX" # archs taken from... https://en.wikipedia.org/wiki/CUDA#GPUs_supported | |
gcc-version: 8 # gcc versions taken from... https://gist.github.com/ax3l/9489132#nvcc | |
- cuda-version: 11.3 | |
cuda-arch-list: "6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6+PTX" | |
gcc-version: 10 | |
- cuda-version: 11.6 | |
cuda-arch-list: "6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6+PTX" # 8.7 "should" work for 11.5 and later but appears not to work | |
gcc-version: 10 | |
- cuda-version: 11.7 | |
cuda-arch-list: "6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6+PTX" | |
gcc-version: 10 | |
exclude: | |
- pytorch-version: '1.10' | |
python-version: '3.10' | |
- pytorch-version: '1.10' | |
python-version: 3.11 | |
- pytorch-version: '1.10' | |
cuda-version: 11.6 | |
- pytorch-version: '1.10' | |
cuda-version: 11.7 | |
- pytorch-version: 1.11 | |
python-version: 3.11 | |
- pytorch-version: 1.11 | |
cuda-version: 11.6 | |
- pytorch-version: 1.11 | |
cuda-version: 11.7 | |
- pytorch-version: 1.12 | |
python-version: 3.11 | |
- pytorch-version: 1.12 | |
cuda-version: 11.7 | |
- pytorch-version: 1.13 | |
cuda-version: 10.2 | |
- pytorch-version: 1.13 | |
cuda-version: 11.3 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: DockerHub Login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image and push to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
build-args: | | |
PYTHON_VERSION=${{ matrix.python-version }} | |
PYTORCH_VERSION=${{ matrix.pytorch-version }} | |
CUDA_VERSION=${{ matrix.cuda-version }} | |
CUDA_ARCH_LIST=${{ matrix.cuda-arch-list }} | |
GCC_VERSION=${{ matrix.gcc-version }} | |
context: ./manylinux | |
tags: torchextensionbuilder/manylinux:py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-cu${{ matrix.cuda-version }}${{needs.setup.outputs.image-tag}} | |
push: true | |
build-test-package: | |
name: Build Test Package | |
needs: build-images | |
uses: ./.github/workflows/build-pytorch-extension-wheels.yml | |
with: | |
working-directory: test_extension | |
build-command: python setup.py bdist_wheel | |
test-built-package: | |
name: Test Built Package | |
needs: build-test-package | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', 3.11] | |
pytorch-version: ['1.10', 1.11, 1.12, 1.13] | |
cuda-version: [10.2, 11.3, 11.6, 11.7] | |
exclude: | |
- pytorch-version: '1.10' | |
python-version: '3.10' | |
- pytorch-version: '1.10' | |
python-version: 3.11 | |
- pytorch-version: '1.10' | |
cuda-version: 11.6 | |
- pytorch-version: '1.10' | |
cuda-version: 11.7 | |
- pytorch-version: 1.11 | |
python-version: 3.11 | |
- pytorch-version: 1.11 | |
cuda-version: 11.6 | |
- pytorch-version: 1.11 | |
cuda-version: 11.7 | |
- pytorch-version: 1.12 | |
python-version: 3.11 | |
- pytorch-version: 1.12 | |
cuda-version: 11.7 | |
- pytorch-version: 1.13 | |
cuda-version: 10.2 | |
- pytorch-version: 1.13 | |
cuda-version: 11.3 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Test Requirements | |
run: | | |
python -m pip install -U --force-reinstall pip | |
python -m pip install numpy | |
export FULL_PYTORCH_VERSION=$(python -m pip index versions torch -f https://download.pytorch.org/whl/torch_stable.html | grep -o ${PYTORCH_VERSION}.[0-9]+cu${CUDA_VERSION//.} | head -n 1) | |
python -m pip --no-cache-dir install torch==${FULL_PYTORCH_VERSION} -f https://download.pytorch.org/whl/torch_stable.html | |
env: | |
PYTORCH_VERSION: ${{ matrix.pytorch-version }} | |
CUDA_VERSION: ${{ matrix.cuda-version }} | |
shell: bash | |
- name: Download Cached Wheels | |
uses: actions/download-artifact@v3 | |
with: | |
name: final-wheels | |
path: final-wheels | |
- name: Install Package From Cached Wheels | |
run: python -m pip install final-wheels/*cp$(echo ${{ matrix.python-version }} | sed 's/\.//')*.whl | |
- name: Run Test | |
run: python test_extension/test.py | |
tests-passed: | |
name: Tests Passed | |
needs: test-built-package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Tests Passed | |
run: echo "Tests Passed" |