diff --git a/python/sglang/srt/utils.py b/python/sglang/srt/utils.py index 8c1cdb5d4..2dd68dab4 100644 --- a/python/sglang/srt/utils.py +++ b/python/sglang/srt/utils.py @@ -2054,13 +2054,6 @@ def set_uvicorn_logging_configs(): LOGGING_CONFIG["formatters"]["access"]["datefmt"] = "%Y-%m-%d %H:%M:%S" -def get_ip() -> Optional[str]: - host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "") - if host_ip: - return host_ip - return None - - def get_open_port() -> int: port = os.getenv("SGLANG_PORT") if port is not None: @@ -2400,8 +2393,10 @@ def get_local_ip_auto(fallback: str = None) -> str: 2. Network interface enumeration via get_local_ip_by_nic() 3. Remote connection method via get_local_ip_by_remote() """ - if ip := get_ip(): - return ip + # Try environment variable + host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "") + if host_ip: + return host_ip logger.debug("get_ip failed") # Fallback if ip := get_local_ip_by_nic(): diff --git a/sgl-kernel/python/sgl_kernel/flash_attn.py b/sgl-kernel/python/sgl_kernel/flash_attn.py index 33e959703..f6b87c311 100644 --- a/sgl-kernel/python/sgl_kernel/flash_attn.py +++ b/sgl-kernel/python/sgl_kernel/flash_attn.py @@ -2,7 +2,6 @@ from functools import lru_cache from typing import Optional, Union import torch -import torch.nn as nn try: from sgl_kernel import flash_ops diff --git a/test/srt/openai_server/features/test_json_constrained.py b/test/srt/openai_server/features/test_json_constrained.py index e4fdeecb5..048352b91 100644 --- a/test/srt/openai_server/features/test_json_constrained.py +++ b/test/srt/openai_server/features/test_json_constrained.py @@ -51,10 +51,10 @@ def setup_class(cls, backend: str): ) -class TestJSONConstrainedOutlinesBackend(CustomTestCase): +class TestJSONConstrained(CustomTestCase): @classmethod def setUpClass(cls): - setup_class(cls, backend="outlines") + setup_class(cls, backend="xgrammar") @classmethod def tearDownClass(cls): @@ -137,13 +137,13 @@ class TestJSONConstrainedOutlinesBackend(CustomTestCase): list(executor.map(self.run_decode, json_schemas)) -class TestJSONConstrainedXGrammarBackend(TestJSONConstrainedOutlinesBackend): +class TestJSONConstrainedOutlinesBackend(TestJSONConstrained): @classmethod def setUpClass(cls): - setup_class(cls, backend="xgrammar") + setup_class(cls, backend="outlines") -class TestJSONConstrainedLLGuidanceBackend(TestJSONConstrainedOutlinesBackend): +class TestJSONConstrainedLLGuidanceBackend(TestJSONConstrained): @classmethod def setUpClass(cls): setup_class(cls, backend="llguidance")