-
Notifications
You must be signed in to change notification settings - Fork 151
102 lines (86 loc) · 3.46 KB
/
building.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Building Wheels
on: [workflow_dispatch]
jobs:
wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
python-version: ['3.8', '3.9', '3.10', '3.11']
torch-version: [2.0.0, 2.1.0]
cuda-version: ['cpu', 'cu117', 'cu118', 'cu121']
exclude:
- torch-version: 2.0.0
cuda-version: 'cu121'
- torch-version: 2.1.0
cuda-version: 'cu117'
- os: macos-11
cuda-version: 'cu117'
- os: macos-11
cuda-version: 'cu118'
- os: macos-11
cuda-version: 'cu121'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade setuptools
pip install scipy==1.10.1 # Python 3.8 support
pip list
- name: Free Disk Space (Ubuntu)
if: ${{ runner.os == 'Linux' }}
uses: jlumbroso/free-disk-space@main
- name: Install CUDA ${{ matrix.cuda-version }}
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
bash .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}.sh
- name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
run: |
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.cuda-version }}
python -c "import torch; print('PyTorch:', torch.__version__)"
python -c "import torch; print('CUDA:', torch.version.cuda)"
- name: Set version
if: ${{ runner.os != 'macOS' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_cluster/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`echo ${{ matrix.cuda-version }}`
echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION"
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" setup.py
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" torch_cluster/__init__.py
shell:
bash
- name: Install main package for CPU
if: ${{ matrix.cuda-version == 'cpu' }}
run: |
FORCE_ONLY_CPU=1 python setup.py develop
shell:
bash
- name: Install main package for GPU
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
python setup.py develop
shell:
bash
- name: Test installation
run: |
python -c "import torch_cluster; print('torch-cluster:', torch_cluster.__version__)"
- name: Build wheel
run: |
pip install wheel
python setup.py bdist_wheel --dist-dir=dist
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload wheel
run: |
aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers