-
Notifications
You must be signed in to change notification settings - Fork 62
146 lines (126 loc) · 4.95 KB
/
Copy path_building.yml
File metadata and controls
146 lines (126 loc) · 4.95 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
143
144
145
146
name: Build Wheels for Linux
on: # yamllint disable-line rule:truthy
push:
branches:
- aki/manylinux0
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Everyday at 4:00am UTC/8:00pm PST
concurrency:
group: aki_sunday
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
wheel:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# TODO: Use native manylinux image for cpu.
- {torch-version: 2.7.0, cuda-version: cu128}
- {torch-version: 2.7.0, cuda-version: cu126}
- {torch-version: 2.7.0, cuda-version: cu118}
- {torch-version: 2.6.0, cuda-version: cu126}
- {torch-version: 2.6.0, cuda-version: cu124}
- {torch-version: 2.6.0, cuda-version: cu118}
- {torch-version: 2.5.0, cuda-version: cu124}
- {torch-version: 2.5.0, cuda-version: cu121}
- {torch-version: 2.5.0, cuda-version: cu118}
- {torch-version: 2.4.0, cuda-version: cu124}
- {torch-version: 2.4.0, cuda-version: cu121}
- {torch-version: 2.4.0, cuda-version: cu118}
- {torch-version: 2.3.0, cuda-version: cu121}
- {torch-version: 2.3.0, cuda-version: cu118}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Free up disk space
if: ${{ runner.os == 'Linux' }}
uses: jlumbroso/free-disk-space@v1.3.1
with:
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
tool-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Prepare for build
run: |
# Install dependencies:
pip install --progress-bar off cibuildwheel auditwheel
# Set version:
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
# Set torch cuda arch list:
source .github/workflows/cuda/Linux-env.sh ${{ matrix.cuda-version }}
echo "TORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST" >> $GITHUB_ENV
echo $TORCH_CUDA_ARCH_LIST
echo ${{ env.TORCH_CUDA_ARCH_LIST }}
- name: Build wheels
run: |
# Build wheels:
python -m cibuildwheel --output-dir dist
# Show wheels:
auditwheel show dist/*.whl
ls -ahl dist/
env:
CIBW_ENVIRONMENT: >
FORCE_NINJA=1
FORCE_CUDA=1
CUDA_HOME=/usr/local/cuda
TORCH_CUDA_ARCH_LIST='${{ env.TORCH_CUDA_ARCH_LIST }}'
CIBW_BUILD_FRONTEND: "build; args: --no-isolation"
CIBW_BUILD: "cp311-manylinux_x86_64" # TODO: Unpin Python version.
CIBW_BEFORE_BUILD: >
pip install --progress-bar off ninja &&
pip install --progress-bar off torch==${{ matrix.torch-version }} --index-url https://download.pytorch.org/whl/${{ matrix.cuda-version }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ vars.DOCKERHUB_USERNAME }}/manylinux:${{ matrix.cuda-version }}
CIBW_REPAIR_WHEEL_COMMAND: bash ./tools/repair_wheel.sh ${{ matrix.torch-version }} {dest_dir} {wheel}
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4
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@v5
with:
python-version: 3.9
- 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 }}