Skip to content

Commit 80bd908

Browse files
johnnynunezQiaolin-Yuzhyncs
authored andcommitted
feat: add release workflow for SGLang kernels on aarch64 (sgl-project#6010)
Co-authored-by: Qiaolin-Yu <[email protected]> Co-authored-by: Yineng Zhang <[email protected]>
1 parent 9f7d245 commit 80bd908

File tree

2 files changed

+102
-1
lines changed

2 files changed

+102
-1
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Release SGLang Kernels (aarch64)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- sgl-kernel/python/sgl_kernel/version.py
9+
workflow_dispatch:
10+
inputs:
11+
tag_name:
12+
type: string
13+
required: false
14+
15+
concurrency:
16+
group: release-sglang-kernels-aarch64-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build-cu128-aarch64:
21+
if: github.repository == 'sgl-project/sglang'
22+
runs-on: sgl-kernel-release-node
23+
strategy:
24+
matrix:
25+
python-version: ['3.9']
26+
cuda-version: ['12.8']
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
submodules: 'recursive'
31+
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Build wheels
38+
run: |
39+
cd sgl-kernel
40+
chmod +x ./build.sh
41+
./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}" aarch64
42+
43+
- name: Upload artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: wheel-python${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}-aarch64
47+
path: sgl-kernel/dist/*
48+
49+
release:
50+
needs: build-cu128-aarch64
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Download artifacts
56+
uses: actions/download-artifact@v4
57+
with:
58+
path: sgl-kernel/dist/
59+
merge-multiple: true
60+
pattern: wheel-*
61+
62+
- name: Set tag name
63+
id: set_tag_name
64+
run: |
65+
if [ -z "${{ inputs.tag_name }}" ]; then
66+
TAG_NAME="v$(cat sgl-kernel/python/sgl_kernel/version.py | cut -d'"' -f2)"
67+
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
68+
else
69+
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
70+
fi
71+
72+
- name: Release
73+
uses: softprops/action-gh-release@v2
74+
with:
75+
tag_name: ${{ steps.set_tag_name.outputs.tag_name }}
76+
repository: sgl-project/whl
77+
token: ${{ secrets.WHL_TOKEN }}
78+
files: |
79+
sgl-kernel/dist/*
80+
81+
- name: Clone wheel index
82+
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
83+
env:
84+
WHL_TOKEN: ${{ secrets.WHL_TOKEN }}
85+
86+
- name: Update wheel index
87+
run: python3 scripts/update_kernel_whl_index.py --cuda 128
88+
89+
- name: Push wheel index
90+
run: |
91+
cd sgl-whl
92+
git config --local user.name "github-actions[bot]"
93+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
94+
git add -A
95+
git commit -m "update whl index"
96+
git push

sgl-kernel/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ PYTHON_VERSION=$1
55
CUDA_VERSION=$2
66
PYTHON_ROOT_PATH=/opt/python/cp${PYTHON_VERSION//.}-cp${PYTHON_VERSION//.}
77

8-
ARCH=$(uname -i)
8+
if [ -z "$3" ]; then
9+
ARCH=$(uname -i)
10+
else
11+
ARCH=$3
12+
fi
13+
914
echo "ARCH: $ARCH"
1015
if [ ${ARCH} = "aarch64" ]; then
1116
LIBCUDA_ARCH="sbsa"

0 commit comments

Comments
 (0)