From 41ac0c6d48391e770bb5797869156f302e0cd012 Mon Sep 17 00:00:00 2001 From: Yineng Zhang Date: Sun, 27 Apr 2025 21:00:50 -0700 Subject: [PATCH] chore: upgrade sgl-kernel 0.1.0 (#5690) --- python/pyproject.toml | 2 +- python/sglang/srt/entrypoints/engine.py | 9 +++++++++ scripts/ci_install_dependency.sh | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index ac0c2ec46..adea383ab 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -46,7 +46,7 @@ runtime_common = [ srt = [ "sglang[runtime_common]", - "sgl-kernel==0.0.9.post2", + "sgl-kernel==0.1.0", "flashinfer_python==0.2.3", "torch==2.6.0", "torchvision==0.21.0", diff --git a/python/sglang/srt/entrypoints/engine.py b/python/sglang/srt/entrypoints/engine.py index 32407fe24..b03e3a494 100644 --- a/python/sglang/srt/entrypoints/engine.py +++ b/python/sglang/srt/entrypoints/engine.py @@ -66,6 +66,7 @@ from sglang.srt.utils import ( assert_pkg_version, configure_logger, get_zmq_socket, + is_cuda, kill_process_tree, launch_dummy_health_check_server, maybe_set_triton_cache_manager, @@ -78,6 +79,8 @@ from sglang.version import __version__ logger = logging.getLogger(__name__) asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) +_is_cuda = is_cuda() + class Engine(EngineBase): """ @@ -452,6 +455,12 @@ def _set_envs_and_config(server_args: ServerArgs): "reinstall the latest version by following the instructions " "at https://docs.flashinfer.ai/installation.html.", ) + if _is_cuda: + assert_pkg_version( + "sgl-kernel", + "0.1.0", + "Please reinstall the latest version with `pip install sgl-kernel --force-reinstall`", + ) def sigchld_handler(signum, frame): pid, exitcode = os.waitpid(0, os.WNOHANG) diff --git a/scripts/ci_install_dependency.sh b/scripts/ci_install_dependency.sh index b765a33e8..e9aa3c332 100755 --- a/scripts/ci_install_dependency.sh +++ b/scripts/ci_install_dependency.sh @@ -16,7 +16,7 @@ rm -rf /usr/local/lib/python3.10/dist-packages/sgl_kernel* pip install --upgrade pip # Install sgl-kernel -pip install sgl-kernel==0.0.9.post2 --no-cache-dir +pip install sgl-kernel==0.1.0 --no-cache-dir # Install the main package pip install -e "python[all]"