forked from rusty1s/pytorch_sparse
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (122 loc) · 4.72 KB
/
building.yml
File metadata and controls
142 lines (122 loc) · 4.72 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Building Wheels
on: [workflow_dispatch]
defaults:
run:
shell: bash
jobs:
wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022, ubuntu-22.04-arm]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
torch-version: [2.8.0]
cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128', 'cu129']
exclude:
- torch-version: 2.6.0
cuda-version: 'cu128'
- torch-version: 2.6.0
cuda-version: 'cu129'
- torch-version: 2.7.0
cuda-version: 'cu124'
- torch-version: 2.7.0
cuda-version: 'cu129'
- torch-version: 2.8.0
cuda-version: 'cu118'
- torch-version: 2.8.0
cuda-version: 'cu124'
- os: macos-14
cuda-version: 'cu118'
- os: macos-14
cuda-version: 'cu124'
- os: macos-14
cuda-version: 'cu126'
- os: macos-14
cuda-version: 'cu128'
- os: macos-14
cuda-version: 'cu129'
- os: ubuntu-22.04-arm
cuda-version: 'cu118'
- os: ubuntu-22.04-arm
cuda-version: 'cu124'
- os: ubuntu-22.04-arm
cuda-version: 'cu126'
- os: ubuntu-22.04-arm
cuda-version: 'cu128'
- os: ubuntu-22.04-arm
cuda-version: 'cu129'
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade setuptools
pip install wheel
- name: Install scipy
if: ${{ matrix.python-version == '3.9' }}
run: |
pip install scipy==1.10.1
- 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_sparse/__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_sparse/__init__.py
- name: Install torch-scatter
run: |
pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }}.html
- name: Install METIS
if: ${{ runner.os != 'Windows' }}
run: |
bash .github/workflows/metis.sh
echo WITH_METIS=1 >> $GITHUB_ENV
- name: Install METIS on Windows
if: ${{ runner.os == 'Windows' }}
run: |
# bash .github/workflows/metis-${{ runner.os }}.sh
echo WITH_METIS=0 >> $GITHUB_ENV
- name: Build wheel for CPU
if: ${{ matrix.cuda-version == 'cpu' }}
run: |
python setup.py bdist_wheel --dist-dir=dist
env:
FORCE_ONLY_CPU: 1
WITH_METIS: ${{ env.WITH_METIS }}
- name: Build wheel for GPU
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
python setup.py bdist_wheel --dist-dir=dist
env:
FORCE_CUDA: 1
WITH_METIS: ${{ env.WITH_METIS }}
- 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