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
parent 3d58cd16d9
commit 15097c5c3b
36 changed files with 188 additions and 146 deletions

View File

@@ -1,22 +1,22 @@
# sgl-kernel
# sglang-kernel (prior sgl-kernel)
[Kernel Library](https://github.com/sgl-project/sglang/tree/main/sgl-kernel) for LLM inference engines
<div align="center">
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://github.com/sgl-project/sglang/blob/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/sgl-kernel)](https://pypi.org/project/sgl-kernel)
[![PyPI](https://img.shields.io/pypi/v/sglang-kernel)](https://pypi.org/project/sglang-kernel)
</div>
sgl-kernel provides optimized compute primitives for LLM inference engines, enabling efficient inference for large language models and vision-language models through custom kernel operations. It has been used by [LightLLM](https://github.com/ModelTC/LightLLM), [SGLang](https://github.com/sgl-project/sglang) and so on.
`sglang-kernel` provides optimized compute primitives for LLM inference engines, enabling efficient inference for large language models and vision-language models through custom kernel operations. The source tree remains under the `sgl-kernel/` directory and the Python import path remains `sgl_kernel`.
## Installation
Requires torch == 2.9.1
```bash
# Latest version
pip3 install sgl-kernel --upgrade
pip3 install sglang-kernel --upgrade
```
## Building from Source
@@ -26,7 +26,7 @@ Requires
- scikit-build-core
- ninja(optional)
### Use Makefile to build sgl-kernel
### Use Makefile to build from the sgl-kernel source tree
```bash
make build
@@ -125,10 +125,10 @@ This tool requires `cubloaty` (install with `pip install cubloaty`) to work.
pip install cubloaty
# Analyze a wheel file
python analyze_whl_kernel_sizes.py path/to/sgl_kernel-*.whl
python analyze_whl_kernel_sizes.py path/to/sglang_kernel-*.whl
# Custom output file
python analyze_whl_kernel_sizes.py path/to/sgl_kernel-*.whl --output my_analysis.txt
python analyze_whl_kernel_sizes.py path/to/sglang_kernel-*.whl --output my_analysis.txt
```
The tool generates:

View File

@@ -197,7 +197,7 @@ def generate_report(all_kernels, output_file):
def main():
parser = argparse.ArgumentParser(
description="Analyze CUDA kernel sizes in sgl-kernel whl file"
description="Analyze CUDA kernel sizes in sglang-kernel wheel files"
)
parser.add_argument("whl", type=str, help="Path to whl file")
parser.add_argument(

View File

@@ -7,8 +7,8 @@ requires = [
build-backend = "scikit_build_core.build"
[project]
name = "sgl-kernel"
version = "0.3.21"
name = "sglang-kernel"
version = "0.4.0"
authors = [
{ name="SGLang Kernel Team", email="sglang@lmsys.org" },
]

View File

@@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build"
[project]
name = "sglang-kernel-cpu"
version = "0.3.21"
version = "0.4.0"
description = "Kernel Library for SGLang"
readme = "README.md"
requires-python = ">=3.10"

View File

@@ -9,8 +9,8 @@ requires = [
build-backend = "setuptools.build_meta"
[project]
name = "sgl-kernel"
version = "0.3.20"
name = "sglang-kernel"
version = "0.4.0"
description = "Kernel Library for SGLang"
readme = "README.md"
requires-python = ">=3.10"

View File

@@ -8,8 +8,8 @@ requires = [
build-backend = "setuptools.build_meta"
[project]
name = "sgl-kernel"
version = "0.3.21"
name = "sglang-kernel"
version = "0.4.0"
description = "Kernel Library for SGLang"
readme = "README.md"
requires-python = ">=3.10"

View File

@@ -169,10 +169,10 @@ def _load_architecture_specific_ops():
cuda_version = torch.version.cuda
if cuda_version and cuda_version.startswith("13"):
install_hint = (
"pip install sgl-kernel --index-url https://docs.sglang.ai/whl/cu130/"
"pip install sglang-kernel --index-url https://docs.sglang.ai/whl/cu130/"
)
else:
install_hint = "pip install --upgrade sgl_kernel"
install_hint = "pip install --upgrade sglang-kernel"
error_msg = f"""
[sgl_kernel] CRITICAL: Could not load any common_ops library!

View File

@@ -1 +1 @@
__version__ = "0.3.21"
__version__ = "0.4.0"

View File

@@ -197,7 +197,7 @@ class _CustomBuildExt(BuildExtension):
setup(
name="sgl-kernel",
name="sglang-kernel",
version=_get_version(),
packages=find_packages(where="python"),
package_dir={"": "python"},

View File

@@ -118,7 +118,7 @@ ext_modules = [
]
setup(
name="sgl-kernel",
name="sglang-kernel",
version=_get_version(),
packages=find_packages(where="python"),
package_dir={"": "python"},