-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (116 loc) · 4.09 KB
/
wheel.yml
File metadata and controls
138 lines (116 loc) · 4.09 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
name: Build Wheels
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
wheel:
name: Build wheel (CUDA ${{ matrix.cuda_version }})
runs-on: ubuntu-24.04
container:
image: ${{ matrix.cuda_image }}
strategy:
matrix:
include:
# disabled for now
#- cuda_version: "12.8"
# cuda_image: "nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04"
# wheel_tag: "cu128"
# archs: "80;90;100;120"
- cuda_version: "13.0"
cuda_image: "nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04"
wheel_tag: "cu130"
archs: "80;90;100f;120f"
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER: gcc-13
CMAKE_CXX_COMPILER: g++-13
CUDAARCHS: ${{ matrix.archs }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install deps
run: apt update && apt install -y git g++-13
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Build wheel
run: uv build --wheel
- name: Repair wheel with auditwheel
run: |
uv run --no-project --with auditwheel --with patchelf auditwheel repair dist/*.whl -w wheelhouse/ --exclude libcuda.so.1 --exclude libcudart.so.12 --exclude libcudart.so.13 --exclude libnvidia-ml.so.1
rm dist/*-linux_*.whl # Remove non-repaired wheel
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.wheel_tag }}
path: wheelhouse/pygpubench*.whl
gpu-test:
name: GPU tests (Modal L4)
needs: wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download wheel
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist/
merge-multiple: true
- name: Install Modal
run: pip install modal
- name: Run GPU tests
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
run: modal run ci/modal_gpu_test.py --wheel dist/pygpubench*.whl --test-dir test
release:
name: Publish to GitHub Releases
needs: wheel
runs-on: ubuntu-24.04
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist/
merge-multiple: true
- name: Get version and short SHA
id: meta
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
TAG="v${VERSION}-${SHORT_SHA}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Delete existing release if tag exists
run: gh release delete "${{ steps.meta.outputs.tag }}" --yes || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
run: |
gh release create "${{ steps.meta.outputs.tag }}" dist/*.whl \
${{ github.event_name == 'push' && '--prerelease' || '' }} \
--title "pygpubench ${{ steps.meta.outputs.tag }}" \
--notes "Built from commit ${{ github.sha }}.
Install with:
\`\`\`
pip install pygpubench --find-links https://github.com/${{ github.repository }}/releases/download/${{ steps.meta.outputs.tag }}/
\`\`\`
Or install the latest release:
\`\`\`
pip install pygpubench --find-links https://github.com/${{ github.repository }}/releases/latest/download/
\`\`\`"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}