Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
9b7cf9ee
Unverified
Commit
9b7cf9ee
authored
Mar 24, 2025
by
Yineng Zhang
Committed by
GitHub
Mar 24, 2025
Browse files
support cu128 sgl-kernel (#4744)
parent
1e86457c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
8 deletions
+115
-8
.github/workflows/release-whl-kernel-cu128.yml
.github/workflows/release-whl-kernel-cu128.yml
+92
-0
scripts/update_kernel_whl_index.py
scripts/update_kernel_whl_index.py
+23
-8
No files found.
.github/workflows/release-whl-kernel-cu128.yml
0 → 100644
View file @
9b7cf9ee
name
:
Release SGLang Kernel Wheel (cu128)
on
:
workflow_dispatch
:
inputs
:
tag_name
:
type
:
string
push
:
branches
:
-
main
paths
:
-
sgl-kernel/python/sgl_kernel/version.py
jobs
:
build-wheels
:
if
:
github.repository == 'sgl-project/sglang'
runs-on
:
ubuntu-latest
strategy
:
matrix
:
python-version
:
[
'
3.9'
]
cuda-version
:
[
'
12.8'
]
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
:
Build wheels for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }}
run
:
|
cd sgl-kernel
chmod +x ./build.sh
./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}"
-
name
:
Upload artifacts
uses
:
actions/upload-artifact@v4
with
:
name
:
wheel-python${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}
path
:
sgl-kernel/dist/*
release
:
needs
:
build-wheels
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v4
-
name
:
Download artifacts
uses
:
actions/download-artifact@v4
with
:
path
:
sgl-kernel/dist/
merge-multiple
:
true
pattern
:
wheel-*
-
name
:
Set tag name
id
:
set_tag_name
run
:
|
if [ -z "${{ inputs.tag_name }}" ]; then
TAG_NAME="v$(cat sgl-kernel/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
fi
-
name
:
Release
uses
:
softprops/action-gh-release@v2
with
:
tag_name
:
${{ steps.set_tag_name.outputs.tag_name }}
repository
:
sgl-project/whl
token
:
${{ secrets.WHL_TOKEN }}
files
:
|
sgl-kernel/dist/*
-
name
:
Clone wheel index
run
:
git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
env
:
WHL_TOKEN
:
${{ secrets.WHL_TOKEN }}
-
name
:
Update wheel index
run
:
python3 scripts/update_kernel_whl_index.py --cuda
128
-
name
:
Push wheel index
run
:
|
cd sgl-whl
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "update whl index"
git push
scripts/update_kernel_whl_index.py
View file @
9b7cf9ee
# Reference: https://github.com/flashinfer-ai/flashinfer/blob/v0.2.0/scripts/update_whl_index.py
# Reference: https://github.com/flashinfer-ai/flashinfer/blob/v0.2.0/scripts/update_whl_index.py
import
argparse
import
hashlib
import
hashlib
import
pathlib
import
pathlib
import
re
import
re
for
path
in
sorted
(
pathlib
.
Path
(
"sgl-kernel/dist"
).
glob
(
"*.whl"
)):
def
update_wheel_index
(
cuda_version
=
"118"
):
index_dir
=
pathlib
.
Path
(
f
"sgl-whl/cu
{
cuda_version
}
/sgl-kernel"
)
index_dir
.
mkdir
(
exist_ok
=
True
)
base_url
=
"https://github.com/sgl-project/whl/releases/download"
for
path
in
sorted
(
pathlib
.
Path
(
"sgl-kernel/dist"
).
glob
(
"*.whl"
)):
with
open
(
path
,
"rb"
)
as
f
:
with
open
(
path
,
"rb"
)
as
f
:
sha256
=
hashlib
.
sha256
(
f
.
read
()).
hexdigest
()
sha256
=
hashlib
.
sha256
(
f
.
read
()).
hexdigest
()
ver
=
re
.
findall
(
r
"sgl_kernel-([0-9.]+(?:\.post[0-9]+)?)-"
,
path
.
name
)[
0
]
ver
=
re
.
findall
(
r
"sgl_kernel-([0-9.]+(?:\.post[0-9]+)?)-"
,
path
.
name
)[
0
]
index_dir
=
pathlib
.
Path
(
f
"sgl-whl/cu118/sgl-kernel"
)
index_dir
.
mkdir
(
exist_ok
=
True
)
base_url
=
"https://github.com/sgl-project/whl/releases/download"
full_url
=
f
"
{
base_url
}
/v
{
ver
}
/
{
path
.
name
}
#sha256=
{
sha256
}
"
full_url
=
f
"
{
base_url
}
/v
{
ver
}
/
{
path
.
name
}
#sha256=
{
sha256
}
"
with
(
index_dir
/
"index.html"
).
open
(
"a"
)
as
f
:
with
(
index_dir
/
"index.html"
).
open
(
"a"
)
as
f
:
f
.
write
(
f
'<a href="
{
full_url
}
">
{
path
.
name
}
</a><br>
\n
'
)
f
.
write
(
f
'<a href="
{
full_url
}
">
{
path
.
name
}
</a><br>
\n
'
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--cuda"
,
type
=
str
,
default
=
"118"
)
args
=
parser
.
parse_args
()
update_wheel_index
(
args
.
cuda
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment