Skip to content

Release

Release #50

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release Version'
required: true
type: string
push:
branches: [main]
pull_request:
branches: ["*"]
jobs:
wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
python-version: ['3.10', '3.11', '3.12']
include-combo:
# Need ubuntu 20.04 for this which is not supported anymore
# - torch-version: '1.13.1'
# cuda-version: 'cpu'
# - torch-version: '1.13.1'
# cuda-version: 'cu117'
- torch-version: '2.0.1'
cuda-version: 'cpu'
- torch-version: '2.0.1'
cuda-version: 'cu117'
- torch-version: '2.0.1'
cuda-version: 'cu118'
- torch-version: '2.1.0'
cuda-version: 'cpu'
- torch-version: '2.1.0'
cuda-version: 'cu118'
- torch-version: '2.1.0'
cuda-version: 'cu121'
- torch-version: '2.4.1'
cuda-version: 'cpu'
- torch-version: '2.4.1'
cuda-version: 'cu118'
- torch-version: '2.4.1'
cuda-version: 'cu121'
- torch-version: '2.4.1'
cuda-version: 'cu124'
- torch-version: '2.5.1'
cuda-version: 'cpu'
- torch-version: '2.5.1'
cuda-version: 'cu118'
- torch-version: '2.5.1'
cuda-version: 'cu121'
- torch-version: '2.5.1'
cuda-version: 'cu124'
- torch-version: '2.6.0'
cuda-version: 'cpu'
- torch-version: '2.6.0'
cuda-version: 'cu118'
- torch-version: '2.6.0'
cuda-version: 'cu124'
- torch-version: '2.6.0'
cuda-version: 'cu126'
exclude:
# torch 2.0.1 is not available for python 3.12
- python-version: '3.12'
include-combo:
torch-version: '2.0.1'
cuda-version: 'cpu'
- python-version: '3.12'
include-combo:
torch-version: '2.0.1'
cuda-version: 'cu117'
- python-version: '3.12'
include-combo:
torch-version: '2.0.1'
cuda-version: 'cu118'
# torch 2.1.0 is not available for python 3.12
- python-version: '3.12'
include-combo:
torch-version: '2.1.0'
cuda-version: 'cpu'
- python-version: '3.12'
include-combo:
torch-version: '2.1.0'
cuda-version: 'cu118'
- python-version: '3.12'
include-combo:
torch-version: '2.1.0'
cuda-version: 'cu121'
steps:
- name: Free disk space
run: |
df -h
sudo rm -rf /usr/share/dotnet /usr/share/swift /opt/hostedtoolcache/CodeQL
df -h
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python3 -m pip install --upgrade pip setuptools
- name: Install CUDA ${{ matrix.include-combo.cuda-version }}
if: ${{ matrix.include-combo.cuda-version != 'cpu' }}
run: |
.github/workflows/cuda/install.sh "${{ matrix.include-combo.cuda-version }}" "${{ runner.os }}"
- name: Install PyTorch ${{ matrix.include-combo.torch-version }}+${{ matrix.include-combo.cuda-version }}
run: |
python3 -m pip install torch==${{ matrix.include-combo.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.include-combo.cuda-version }}
python3 -c "import torch; print('PyTorch:', torch.__version__)"
python3 -c "import torch; print('CUDA:', torch.version.cuda)"
- id: build-wheel
name: Build wheel
env:
TORCHSORT_VERSION_SUFFIX: "+${{ matrix.include-combo.cuda-version }}-torch${{ matrix.include-combo.torch-version }}"
run: |
export PATH=/usr/local/cuda/bin:$PATH
export FORCE_CUDA=1
export TORCH_CUDA_ARCH_LIST="6.0;7.0;7.5;8.0;8.6+PTX"
TORCH_VERSION=`echo "pt${{ matrix.include-combo.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`echo ${{ matrix.include-combo.cuda-version }}`
export TORCHSORT_VERSION_SUFFIX="+$TORCH_VERSION$CUDA_VERSION"
python3 -m pip install wheel
python3 setup.py bdist_wheel --dist-dir=dist
echo "distname=$(ls dist)" >> ${GITHUB_OUTPUT}
shell: bash
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-wheel.outputs.distname }}
path: dist/${{ steps.build-wheel.outputs.distname }}
release:
if: ${{ inputs.release_version || startsWith(github.ref, 'refs/tags/') }}
needs: wheels
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
- uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.release_version }}
allowUpdates: true
omitName: true
omitBody: true
artifacts: "*/*.whl"