update version setup for sgl-kernel (#3079)
This commit is contained in:
2
.github/workflows/release-pypi-kernel.yml
vendored
2
.github/workflows/release-pypi-kernel.yml
vendored
@@ -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:
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
### 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
|
|||||||
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 = [
|
|||||||
|
|
||||||
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,
|
||||||
|
|||||||
1
sgl-kernel/version.py
Normal file
1
sgl-kernel/version.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__version__ = "0.0.2.post15"
|
||||||
Reference in New Issue
Block a user