forked from pyg-team/pyg-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (133 loc) · 4.99 KB
/
nightly.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
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
143
144
145
146
147
148
149
150
name: Nightly Wheels
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Everyday at 4:00am UTC/8:00pm PST
jobs:
wheel:
if: github.repository == 'pyg-team/pyg-lib'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0]
cuda-version: ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121']
exclude:
- torch-version: 1.12.0
python-version: '3.12'
- torch-version: 1.13.0
python-version: '3.12'
- torch-version: 2.0.0
python-version: '3.12'
- torch-version: 2.1.0
python-version: '3.12'
- torch-version: 1.12.0
python-version: '3.11'
- torch-version: 1.12.0
cuda-version: 'cu117'
- torch-version: 1.12.0
cuda-version: 'cu118'
- torch-version: 1.12.0
cuda-version: 'cu121'
- torch-version: 1.13.0
python-version: '3.11'
- torch-version: 1.13.0
cuda-version: 'cu113'
- torch-version: 1.13.0
cuda-version: 'cu118'
- torch-version: 1.13.0
cuda-version: 'cu121'
- torch-version: 2.0.0
cuda-version: 'cu113'
- torch-version: 2.0.0
cuda-version: 'cu116'
- torch-version: 1.13.0
cuda-version: 'cu121'
- torch-version: 2.1.0
cuda-version: 'cu113'
- torch-version: 2.1.0
cuda-version: 'cu116'
- torch-version: 2.1.0
cuda-version: 'cu117'
- torch-version: 2.2.0
cuda-version: 'cu113'
- torch-version: 2.2.0
cuda-version: 'cu116'
- torch-version: 2.2.0
cuda-version: 'cu117'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup packages
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
torch-version: ${{ matrix.torch-version }}
cuda-version: ${{ matrix.cuda-version }}
- name: Set version on non-macOS
if: ${{ runner.os != 'macOS' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`echo ${{ matrix.cuda-version }}`
TODAY=`date +'%Y%m%d'`
echo "New version name: $VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION"
sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" setup.py
sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" pyg_lib/__init__.py
shell: bash
- name: Set version on macOS
if: ${{ runner.os == 'macOS' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
TODAY=`date +'%Y%m%d'`
echo "New version name: $VERSION.dev$TODAY+$TORCH_VERSION"
sed -i "" "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION/" setup.py
sed -i "" "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION/" pyg_lib/__init__.py
shell: bash
- name: Build wheel
run: |
source ./.github/workflows/cuda/${{ runner.os }}-env.sh ${{ matrix.cuda-version }}
python setup.py bdist_wheel --dist-dir=dist
shell: bash
- name: Test wheel
run: |
cd dist
ls -lah
pip install *.whl
python -c "import pyg_lib; print('pyg-lib:', pyg_lib.__version__)"
python -c "import pyg_lib; print('CUDA:', pyg_lib.cuda_version())"
cd ..
- 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/nightly/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
boto3:
if: ${{ always() }}
needs: [wheel]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install boto3
- name: Upload index
run: |
python ./.github/workflows/aws/upload_nightly_index.py
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}