[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
+7 -7
View File
@@ -109,11 +109,11 @@ python scripts/release/bump_kernel_version.py 0.4.0
```
**Files updated:**
- `sgl-kernel/pyproject.toml`
- `sgl-kernel/pyproject_cpu.toml`
- `sgl-kernel/pyproject_rocm.toml`
- `sgl-kernel/pyproject_musa.toml`
- `sgl-kernel/python/sgl_kernel/version.py`
- `python/sglang/kernels/aot/pyproject.toml`
- `python/sglang/kernels/aot/pyproject_cpu.toml`
- `python/sglang/kernels/aot/pyproject_rocm.toml`
- `python/sglang/kernels/aot/pyproject_musa.toml`
- `python/sglang/kernels/aot/python/sgl_kernel/version.py`
## Manual Testing Instructions
@@ -155,8 +155,8 @@ python scripts/release/bump_kernel_version.py 0.4.0
3. **Check specific files contain the new version:**
```bash
grep -r "0.4.0" sgl-kernel/python/sgl_kernel/version.py
grep -r "0.4.0" sgl-kernel/pyproject.toml
grep -r "0.4.0" python/sglang/kernels/aot/python/sgl_kernel/version.py
grep -r "0.4.0" python/sglang/kernels/aot/pyproject.toml
```
4. **Reset changes (if testing):**
+6 -6
View File
@@ -16,14 +16,14 @@ def main():
)
args = parser.parse_args()
version_file = Path("sgl-kernel/python/sgl_kernel/version.py")
version_file = Path("python/sglang/kernels/aot/python/sgl_kernel/version.py")
files_to_update = [
Path("sgl-kernel/pyproject.toml"),
Path("sgl-kernel/pyproject_cpu.toml"),
Path("sgl-kernel/pyproject_rocm.toml"),
Path("sgl-kernel/pyproject_musa.toml"),
Path("sgl-kernel/python/sgl_kernel/version.py"),
Path("python/sglang/kernels/aot/pyproject.toml"),
Path("python/sglang/kernels/aot/pyproject_cpu.toml"),
Path("python/sglang/kernels/aot/pyproject_rocm.toml"),
Path("python/sglang/kernels/aot/pyproject_musa.toml"),
Path("python/sglang/kernels/aot/python/sgl_kernel/version.py"),
]
bump_version(args.new_version, version_file, files_to_update)
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Bump sglang-kernel version in SGLang files to match the version in sgl-kernel/pyproject.toml.
Bump SGLang's kernel dependencies to match the AOT source pyproject.
Updates:
- python/pyproject.toml
- python/sglang/srt/entrypoints/engine.py
@@ -18,8 +18,8 @@ except ImportError:
def get_kernel_version_from_source() -> str:
"""Extract version from sgl-kernel/pyproject.toml"""
pyproject_path = Path("sgl-kernel/pyproject.toml")
"""Extract the version from the AOT source pyproject."""
pyproject_path = Path("python/sglang/kernels/aot/pyproject.toml")
if not pyproject_path.exists():
print(f"Error: {pyproject_path} not found")
@@ -30,7 +30,9 @@ def get_kernel_version_from_source() -> str:
version = data.get("project", {}).get("version")
if not version:
print("Error: Could not find version in sgl-kernel/pyproject.toml")
print(
"Error: Could not find version in python/sglang/kernels/aot/pyproject.toml"
)
sys.exit(1)
return version
@@ -1,7 +1,9 @@
#!/usr/bin/env python3
"""
Check if sglang-kernel version from sgl-kernel/pyproject.toml matches the versions
used in SGLang files (python/pyproject.toml, engine.py, and Dockerfile).
Check whether SGLang's kernel dependencies match the AOT source pyproject.
The dependent versions are read from python/pyproject.toml, engine.py, and
Dockerfile.
Sets GitHub Actions output variables to indicate if sync is needed.
"""
@@ -17,8 +19,8 @@ except ImportError:
def get_kernel_version_from_source() -> str:
"""Extract version from sgl-kernel/pyproject.toml (line 11)"""
pyproject_path = Path("sgl-kernel/pyproject.toml")
"""Extract the version from the AOT source pyproject."""
pyproject_path = Path("python/sglang/kernels/aot/pyproject.toml")
if not pyproject_path.exists():
print(f"Error: {pyproject_path} not found")
@@ -29,7 +31,9 @@ def get_kernel_version_from_source() -> str:
version = data.get("project", {}).get("version")
if not version:
print("Error: Could not find version in sgl-kernel/pyproject.toml")
print(
"Error: Could not find version in python/sglang/kernels/aot/pyproject.toml"
)
sys.exit(1)
return version
@@ -101,7 +105,9 @@ def main():
engine_version = get_kernel_version_from_engine()
dockerfile_version = get_kernel_version_from_dockerfile()
print(f"Kernel version in sgl-kernel/pyproject.toml: {kernel_version}")
print(
f"Kernel version in python/sglang/kernels/aot/pyproject.toml: {kernel_version}"
)
print(
f"SGLang kernel dependency version in python/pyproject.toml: {pyproject_version}"
)
@@ -28,7 +28,7 @@ git add -A
git commit -m "chore: bump sglang-kernel version to ${KERNEL_VERSION} in SGLang
This commit updates the sglang-kernel version across SGLang files to match
the version defined in sgl-kernel/pyproject.toml.
the version defined in python/sglang/kernels/aot/pyproject.toml.
Files updated:
${COMMIT_FILES}
@@ -45,7 +45,7 @@ PR_URL=$(gh pr create \
--title "chore: bump sglang-kernel version to ${KERNEL_VERSION}" \
--body "## Summary
This PR bumps the \`sglang-kernel\` version to \`${KERNEL_VERSION}\` across SGLang files to match the version defined in \`sgl-kernel/pyproject.toml\`.
This PR bumps the \`sglang-kernel\` version to \`${KERNEL_VERSION}\` across SGLang files to match the version defined in \`python/sglang/kernels/aot/pyproject.toml\`.
**Kernel Version:** \`${KERNEL_VERSION}\`
@@ -54,7 +54,7 @@ ${FILES_LIST}
## Context
The kernel version in \`sgl-kernel/pyproject.toml\` has been updated. This PR ensures that all SGLang files referencing the \`sglang-kernel\` dependency are updated accordingly:
The kernel version in \`python/sglang/kernels/aot/pyproject.toml\` has been updated. This PR ensures that all SGLang files referencing the \`sglang-kernel\` dependency are updated accordingly:
- \`python/pyproject.toml\` - dependency specification
- \`python/sglang/srt/entrypoints/engine.py\` - version check
- \`docker/Dockerfile\` - Docker build argument