-
Notifications
You must be signed in to change notification settings - Fork 34
83 lines (80 loc) · 2.69 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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-20.04]
python-version: ['3.10', '3.11']
torch-version: ['1.13.1', '2.0.1']
cuda-version: ['cpu', 'cu113', 'cu117', 'cu118']
exclude:
- torch-version: 1.13.1
cuda-version: cu118
- torch-version: 2.0.1
cuda-version: cu113
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.cuda-version }}
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
.github/workflows/cuda/install.sh "${{ matrix.cuda-version }}" "${{ runner.os }}"
- name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
run: |
python3 -m pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.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.cuda-version }}-torch${{ matrix.torch-version }}"
run: |
export FORCE_CUDA=1
export TORCH_CUDA_ARCH_LIST="3.5;5.0+PTX;6.0;7.0;7.5;8.0;8.6"
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@v3
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@v3
- uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.release_version }}
allowUpdates: true
omitName: true
omitBody: true
artifacts: "*/*.whl"