[Kernel] Move sgl-kernel under sglang.kernels.aot (#32648)

This commit is contained in:
Xiaoyu Zhang
2026-07-29 17:25:00 +08:00
committed by GitHub
parent 1b9dfa14e6
commit c32c4ef79c
370 changed files with 300 additions and 269 deletions
+32 -32
View File
@@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- sgl-kernel/python/sgl_kernel/version.py
- python/sglang/kernels/aot/python/sgl_kernel/version.py
workflow_dispatch:
inputs:
target:
@@ -54,7 +54,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
# Self-hosted build nodes retain the workspace across jobs. Prior builds
# leave root-owned artifacts under sgl-kernel/build/ that actions/checkout
# leave root-owned artifacts under python/sglang/kernels/aot/build/ that actions/checkout
# cannot remove, causing EACCES on rmdir. Wipe them via a throwaway root
# container before checkout recreates the workspace.
- name: Clean workspace (remove root-owned files from prior runs)
@@ -74,7 +74,7 @@ jobs:
- name: Build wheels
run: |
cd sgl-kernel
cd python/sglang/kernels/aot
chmod +x ./build.sh
./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}" ${{ matrix.arch == 'aarch64' && 'aarch64' || '' }}
env:
@@ -85,7 +85,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: wheel-python${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}
path: sgl-kernel/dist/*
path: python/sglang/kernels/aot/dist/*
release-cu129:
needs: build-cu129-matrix
@@ -98,7 +98,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
path: python/sglang/kernels/aot/dist/
merge-multiple: true
pattern: wheel-*
@@ -106,7 +106,7 @@ jobs:
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)"
TAG_NAME="v$(cat python/sglang/kernels/aot/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
@@ -119,7 +119,7 @@ jobs:
repository: sgl-project/whl
token: ${{ secrets.GH_PAT_FOR_WHL_RELEASE }}
files: |
sgl-kernel/dist/*
python/sglang/kernels/aot/dist/*
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
@@ -155,7 +155,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
# Self-hosted build nodes retain the workspace across jobs. Prior builds
# leave root-owned artifacts under sgl-kernel/build/ that actions/checkout
# leave root-owned artifacts under python/sglang/kernels/aot/build/ that actions/checkout
# cannot remove, causing EACCES on rmdir. Wipe them via a throwaway root
# container before checkout recreates the workspace.
- name: Clean workspace (remove root-owned files from prior runs)
@@ -175,7 +175,7 @@ jobs:
- name: Build wheels
run: |
cd sgl-kernel
cd python/sglang/kernels/aot
chmod +x ./build.sh
./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}" ${{ matrix.arch == 'aarch64' && 'aarch64' || '' }}
env:
@@ -183,7 +183,7 @@ jobs:
NVCC_THREADS: 8
- name: Strip +cu130 local version for PyPI upload
working-directory: sgl-kernel
working-directory: python/sglang/kernels/aot
run: |
set -eux
pip install wheel
@@ -208,7 +208,7 @@ jobs:
ls -lh dist-pypi/
- name: Upload to PyPI
working-directory: sgl-kernel
working-directory: python/sglang/kernels/aot
run: |
pip install twine
python3 -m twine upload --skip-existing dist-pypi/* -u __token__ -p ${{ secrets.PYPI_TOKEN_SGLANG_KERNEL }}
@@ -217,7 +217,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: wheel-python${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}
path: sgl-kernel/dist/*
path: python/sglang/kernels/aot/dist/*
release-cu130:
needs: build-cu130-matrix
@@ -230,7 +230,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
path: python/sglang/kernels/aot/dist/
merge-multiple: true
pattern: wheel-*
@@ -238,7 +238,7 @@ jobs:
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)"
TAG_NAME="v$(cat python/sglang/kernels/aot/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
@@ -251,7 +251,7 @@ jobs:
repository: sgl-project/whl
token: ${{ secrets.GH_PAT_FOR_WHL_RELEASE }}
files: |
sgl-kernel/dist/*
python/sglang/kernels/aot/dist/*
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
@@ -281,7 +281,7 @@ jobs:
rocm-version: ["700", "720"]
steps:
# Self-hosted build nodes retain the workspace across jobs. Prior builds
# leave root-owned artifacts under sgl-kernel/build/ that actions/checkout
# leave root-owned artifacts under python/sglang/kernels/aot/build/ that actions/checkout
# cannot remove, causing EACCES on rmdir. Wipe them via a throwaway root
# container before checkout recreates the workspace.
- name: Clean workspace (remove root-owned files from prior runs)
@@ -301,8 +301,8 @@ jobs:
- name: Build wheels
run: |
cp 3rdparty/amd/wheel/sgl-kernel/* sgl-kernel/
cd sgl-kernel
cp 3rdparty/amd/wheel/sgl-kernel/* python/sglang/kernels/aot/
cd python/sglang/kernels/aot
chmod +x ./build_rocm.sh
./build_rocm.sh "${{ matrix.rocm-version }}"
@@ -310,7 +310,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: wheel-python${{ matrix.python-version }}-rocm${{ matrix.rocm-version }}
path: sgl-kernel/dist/*
path: python/sglang/kernels/aot/dist/*
release-rocm700:
needs: build-rocm-matrix
@@ -323,7 +323,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
path: python/sglang/kernels/aot/dist/
merge-multiple: true
pattern: wheel-*-rocm700
@@ -331,7 +331,7 @@ jobs:
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)"
TAG_NAME="v$(cat python/sglang/kernels/aot/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
@@ -344,7 +344,7 @@ jobs:
repository: sgl-project/whl
token: ${{ secrets.GH_PAT_FOR_WHL_RELEASE }}
files: |
sgl-kernel/dist/*
python/sglang/kernels/aot/dist/*
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
@@ -374,7 +374,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
path: python/sglang/kernels/aot/dist/
merge-multiple: true
pattern: wheel-*-rocm720
@@ -382,7 +382,7 @@ jobs:
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)"
TAG_NAME="v$(cat python/sglang/kernels/aot/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
@@ -395,7 +395,7 @@ jobs:
repository: sgl-project/whl
token: ${{ secrets.GH_PAT_FOR_WHL_RELEASE }}
files: |
sgl-kernel/dist/*
python/sglang/kernels/aot/dist/*
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl
@@ -425,7 +425,7 @@ jobs:
musa-version: ["43"]
steps:
# Self-hosted build nodes retain the workspace across jobs. Prior builds
# leave root-owned artifacts under sgl-kernel/build/ that actions/checkout
# leave root-owned artifacts under python/sglang/kernels/aot/build/ that actions/checkout
# cannot remove, causing EACCES on rmdir. Wipe them via a throwaway root
# container before checkout recreates the workspace.
- name: Clean workspace (remove root-owned files from prior runs)
@@ -451,19 +451,19 @@ jobs:
- name: Build wheels
run: |
cd sgl-kernel
cd python/sglang/kernels/aot
mv pyproject_musa.toml pyproject.toml
python setup_musa.py sdist bdist_wheel
- name: Rename MUSA wheels
run: |
bash scripts/ci/musa/rename_wheels_musa.sh ${{ matrix.musa-version }} sgl-kernel/dist
bash scripts/ci/musa/rename_wheels_musa.sh ${{ matrix.musa-version }} python/sglang/kernels/aot/dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheel-python${{ matrix.python-version }}-musa${{ matrix.musa-version }}
path: sgl-kernel/dist/*
path: python/sglang/kernels/aot/dist/*
release-musa43:
needs: build-musa43
@@ -474,7 +474,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
path: python/sglang/kernels/aot/dist/
merge-multiple: true
pattern: wheel-*
@@ -482,7 +482,7 @@ jobs:
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)"
TAG_NAME="v$(cat python/sglang/kernels/aot/python/sgl_kernel/version.py | cut -d'"' -f2)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
else
echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
@@ -495,7 +495,7 @@ jobs:
repository: sgl-project/whl
token: ${{ secrets.GH_PAT_FOR_WHL_RELEASE }}
files: |
sgl-kernel/dist/*
python/sglang/kernels/aot/dist/*
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/sgl-project/whl.git sgl-whl