Skip to content

Commit

Permalink
update version setup for sgl-kernel (#3079)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs authored Jan 23, 2025
1 parent 1f6cf0d commit 3d0bfa3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-pypi-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- sgl-kernel/pyproject.toml
- sgl-kernel/version.py
workflow_dispatch:

concurrency:
Expand Down
6 changes: 3 additions & 3 deletions sgl-kernel/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Steps to add a new kernel:

1. Implement in [src/sgl-kernel/csrc/](https://github.com/sgl-project/sglang/tree/main/sgl-kernel/src/sgl-kernel/csrc)
2. Expose interface in [csrc/sgl_kernel_ops.cu](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/src/sgl-kernel/csrc/sgl_kernel_ops.cu) with pybind11
3. Create Python wrapper in [src/sgl-kernel/ops/__init__.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/src/sgl-kernel/ops/__init__.py)
4. Expose Python interface in [src/sgl-kernel/__init__.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/src/sgl-kernel/__init__.py)
3. Create Python wrapper in [src/sgl-kernel/ops/\_\_init\_\_.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/src/sgl-kernel/ops/__init__.py)
4. Expose Python interface in [src/sgl-kernel/\_\_init\_\_.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/src/sgl-kernel/__init__.py)
5. Update [setup.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/setup.py) to include new CUDA source

### Build & Install
Expand All @@ -48,4 +48,4 @@ pip3 install dist/*whl --force-reinstall --no-deps

### Release new version

Update version in [pyproject.toml](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/pyproject.toml)
Update version in [pyproject.toml](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/pyproject.toml) and [version.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/version.py)
10 changes: 2 additions & 8 deletions sgl-kernel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
import torch
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
from version import __version__

root = Path(__file__).parent.resolve()


def get_version():
with open(root / "pyproject.toml") as f:
for line in f:
if line.startswith("version"):
return line.split("=")[1].strip().strip('"')


def update_wheel_platform_tag():
wheel_dir = Path("dist")
if wheel_dir.exists() and wheel_dir.is_dir():
Expand Down Expand Up @@ -122,7 +116,7 @@ def get_device_sm():

setup(
name="sgl-kernel",
version=get_version(),
version=__version__,
packages=find_packages(),
package_dir={"": "src"},
ext_modules=ext_modules,
Expand Down
1 change: 1 addition & 0 deletions sgl-kernel/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.2.post15"

0 comments on commit 3d0bfa3

Please sign in to comment.