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
@@ -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