Unverified Commit 3d0bfa3e authored by Yineng Zhang's avatar Yineng Zhang Committed by GitHub
Browse files

update version setup for sgl-kernel (#3079)

parent 1f6cf0d4
...@@ -5,7 +5,7 @@ on: ...@@ -5,7 +5,7 @@ on:
branches: branches:
- main - main
paths: paths:
- sgl-kernel/pyproject.toml - sgl-kernel/version.py
workflow_dispatch: workflow_dispatch:
concurrency: concurrency:
......
...@@ -26,8 +26,8 @@ Steps to add a new kernel: ...@@ -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) 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 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) 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) 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 5. Update [setup.py](https://github.com/sgl-project/sglang/blob/main/sgl-kernel/setup.py) to include new CUDA source
### Build & Install ### Build & Install
...@@ -48,4 +48,4 @@ pip3 install dist/*whl --force-reinstall --no-deps ...@@ -48,4 +48,4 @@ pip3 install dist/*whl --force-reinstall --no-deps
### Release new version ### 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)
...@@ -3,17 +3,11 @@ from pathlib import Path ...@@ -3,17 +3,11 @@ from pathlib import Path
import torch import torch
from setuptools import find_packages, setup from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension from torch.utils.cpp_extension import BuildExtension, CUDAExtension
from version import __version__
root = Path(__file__).parent.resolve() 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(): def update_wheel_platform_tag():
wheel_dir = Path("dist") wheel_dir = Path("dist")
if wheel_dir.exists() and wheel_dir.is_dir(): if wheel_dir.exists() and wheel_dir.is_dir():
...@@ -122,7 +116,7 @@ ext_modules = [ ...@@ -122,7 +116,7 @@ ext_modules = [
setup( setup(
name="sgl-kernel", name="sgl-kernel",
version=get_version(), version=__version__,
packages=find_packages(), packages=find_packages(),
package_dir={"": "src"}, package_dir={"": "src"},
ext_modules=ext_modules, ext_modules=ext_modules,
......
__version__ = "0.0.2.post15"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment