Release sglang kernel 0.4.0 (#20440)

Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
This commit is contained in:
Xiaoyu Zhang
2026-03-16 20:34:58 +08:00
committed by GitHub
co-authored by Baizhou Zhang
parent 3d58cd16d9
commit 15097c5c3b
36 changed files with 188 additions and 146 deletions
+7 -6
View File
@@ -25,17 +25,18 @@ python scripts/release/bump_sglang_version.py 0.5.3rc0
- `python/sglang/version.py`
### `bump_kernel_version.py`
Updates sgl-kernel version across all relevant files following the pattern from [PR #10732](https://github.com/sgl-project/sglang/pull/10732).
Updates the `sglang-kernel` release version across all relevant files following the pattern from [PR #10732](https://github.com/sgl-project/sglang/pull/10732).
**Usage:**
```bash
python scripts/release/bump_kernel_version.py 0.3.12
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`
## Manual Testing Instructions
@@ -68,7 +69,7 @@ python scripts/release/bump_kernel_version.py 0.3.12
1. **Run the script:**
```bash
python scripts/release/bump_kernel_version.py 0.3.13
python scripts/release/bump_kernel_version.py 0.4.0
```
2. **Verify changes with git diff:**
@@ -78,8 +79,8 @@ python scripts/release/bump_kernel_version.py 0.3.12
3. **Check specific files contain the new version:**
```bash
grep -r "0.3.13" sgl-kernel/python/sgl_kernel/version.py
grep -r "0.3.13" sgl-kernel/pyproject.toml
grep -r "0.4.0" sgl-kernel/python/sgl_kernel/version.py
grep -r "0.4.0" sgl-kernel/pyproject.toml
```
4. **Reset changes (if testing):**
@@ -90,6 +91,6 @@ python scripts/release/bump_kernel_version.py 0.3.12
## Version Format Validation
- **SGLang versions:** `X.Y.Z` or `X.Y.ZrcN` (e.g., `0.5.3` or `0.5.3rc0`)
- **Kernel versions:** `X.Y.Z` (e.g., `0.3.12`)
- **Kernel versions:** `X.Y.Z` (e.g., `0.4.0`)
The scripts will validate the version format and exit with an error if invalid.
+1
View File
@@ -22,6 +22,7 @@ def main():
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"),
]
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Bump sgl-kernel version in SGLang files to match the version in sgl-kernel/pyproject.toml.
Bump sglang-kernel version in SGLang files to match the version in sgl-kernel/pyproject.toml.
Updates:
- python/pyproject.toml
- python/sglang/srt/entrypoints/engine.py
@@ -37,7 +37,7 @@ def get_kernel_version_from_source() -> str:
def update_python_pyproject(new_version: str) -> bool:
"""Update sgl-kernel version in python/pyproject.toml"""
"""Update sglang-kernel version in python/pyproject.toml"""
pyproject_path = Path("python/pyproject.toml")
if not pyproject_path.exists():
@@ -46,10 +46,10 @@ def update_python_pyproject(new_version: str) -> bool:
content = pyproject_path.read_text()
# Replace "sgl-kernel==x.x.x" with new version
# Replace "sglang-kernel==x.x.x" with new version
new_content = re.sub(
r'"sgl-kernel==[^"]+"',
f'"sgl-kernel=={new_version}"',
r'"sglang-kernel==[^"]+"',
f'"sglang-kernel=={new_version}"',
content,
)
@@ -63,7 +63,7 @@ def update_python_pyproject(new_version: str) -> bool:
def update_engine_py(new_version: str) -> bool:
"""Update sgl-kernel version in python/sglang/srt/entrypoints/engine.py"""
"""Update sglang-kernel version in python/sglang/srt/entrypoints/engine.py"""
engine_path = Path("python/sglang/srt/entrypoints/engine.py")
if not engine_path.exists():
@@ -72,9 +72,9 @@ def update_engine_py(new_version: str) -> bool:
content = engine_path.read_text()
# Replace version in assert_pkg_version("sgl-kernel", "version", ...)
# Replace version in assert_pkg_version("sglang-kernel", "version", ...)
new_content = re.sub(
r'(assert_pkg_version\s*\(\s*"sgl-kernel"\s*,\s*)"[^"]+"',
r'(assert_pkg_version\s*\(\s*"sglang-kernel"\s*,\s*)"[^"]+"',
rf'\1"{new_version}"',
content,
)
@@ -117,7 +117,7 @@ def update_dockerfile(new_version: str) -> bool:
def main():
kernel_version = get_kernel_version_from_source()
print(f"Bumping sgl-kernel version to: {kernel_version}\n")
print(f"Bumping sglang-kernel version to: {kernel_version}\n")
updated_files = []
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Check if sgl-kernel version from sgl-kernel/pyproject.toml matches the versions
Check if sglang-kernel version from sgl-kernel/pyproject.toml matches the versions
used in SGLang files (python/pyproject.toml, engine.py, and Dockerfile).
Sets GitHub Actions output variables to indicate if sync is needed.
"""
@@ -36,7 +36,7 @@ def get_kernel_version_from_source() -> str:
def get_kernel_version_from_python_pyproject() -> str:
"""Extract sgl-kernel version from python/pyproject.toml"""
"""Extract sglang-kernel version from python/pyproject.toml"""
pyproject_path = Path("python/pyproject.toml")
if not pyproject_path.exists():
@@ -45,17 +45,17 @@ def get_kernel_version_from_python_pyproject() -> str:
content = pyproject_path.read_text()
# Match "sgl-kernel==x.x.x"
match = re.search(r'"sgl-kernel==([^"]+)"', content)
# Match "sglang-kernel==x.x.x"
match = re.search(r'"sglang-kernel==([^"]+)"', content)
if not match:
print("Error: Could not find sgl-kernel version in python/pyproject.toml")
print("Error: Could not find sglang-kernel version in python/pyproject.toml")
sys.exit(1)
return match.group(1)
def get_kernel_version_from_engine() -> str:
"""Extract sgl-kernel version from python/sglang/srt/entrypoints/engine.py"""
"""Extract sglang-kernel version from python/sglang/srt/entrypoints/engine.py"""
engine_path = Path("python/sglang/srt/entrypoints/engine.py")
if not engine_path.exists():
@@ -64,13 +64,13 @@ def get_kernel_version_from_engine() -> str:
content = engine_path.read_text()
# Find the assert_pkg_version call for sgl-kernel
# Look for the pattern: assert_pkg_version("sgl-kernel", "version", ...)
# Find the assert_pkg_version call for sglang-kernel
# Look for the pattern: assert_pkg_version("sglang-kernel", "version", ...)
match = re.search(
r'assert_pkg_version\s*\(\s*"sgl-kernel"\s*,\s*"([^"]+)"', content
r'assert_pkg_version\s*\(\s*"sglang-kernel"\s*,\s*"([^"]+)"', content
)
if not match:
print("Error: Could not find sgl-kernel version in engine.py")
print("Error: Could not find sglang-kernel version in engine.py")
sys.exit(1)
return match.group(1)
@@ -102,8 +102,10 @@ def main():
dockerfile_version = get_kernel_version_from_dockerfile()
print(f"Kernel version in sgl-kernel/pyproject.toml: {kernel_version}")
print(f"Kernel version in python/pyproject.toml: {pyproject_version}")
print(f"Kernel version in engine.py: {engine_version}")
print(
f"SGLang kernel dependency version in python/pyproject.toml: {pyproject_version}"
)
print(f"SGLang kernel dependency version in engine.py: {engine_version}")
print(f"Kernel version in Dockerfile: {dockerfile_version}")
# Check if any version differs from the source
@@ -25,9 +25,9 @@ COMMIT_FILES=$(git diff --name-only | sed 's/^/ - /')
# Commit changes
echo "Committing changes..."
git add -A
git commit -m "chore: bump sgl-kernel version to ${KERNEL_VERSION} in SGLang
git commit -m "chore: bump sglang-kernel version to ${KERNEL_VERSION} in SGLang
This commit updates the sgl-kernel version across SGLang files to match
This commit updates the sglang-kernel version across SGLang files to match
the version defined in sgl-kernel/pyproject.toml.
Files updated:
@@ -42,10 +42,10 @@ git push origin "${BRANCH_NAME}"
# Create pull request
echo "Creating pull request..."
PR_URL=$(gh pr create \
--title "chore: bump sgl-kernel version to ${KERNEL_VERSION}" \
--title "chore: bump sglang-kernel version to ${KERNEL_VERSION}" \
--body "## Summary
This PR bumps the \`sgl-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 \`sgl-kernel/pyproject.toml\`.
**Kernel Version:** \`${KERNEL_VERSION}\`
@@ -54,7 +54,7 @@ ${FILES_LIST}
## Context
The sgl-kernel version in \`sgl-kernel/pyproject.toml\` has been updated. This PR ensures that all SGLang files referencing the kernel version are updated accordingly:
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:
- \`python/pyproject.toml\` - dependency specification
- \`python/sglang/srt/entrypoints/engine.py\` - version check
- \`docker/Dockerfile\` - Docker build argument