From 1a8f5f68367ab2abf7850095d0ca82291348625c Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Tue, 27 May 2025 12:01:16 +0800 Subject: [PATCH] Super tiny rename environment variable (#6648) --- .../srt/disaggregation/mooncake/conn.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/python/sglang/srt/disaggregation/mooncake/conn.py b/python/sglang/srt/disaggregation/mooncake/conn.py index 3b9aa62f7..3f5dc54ef 100644 --- a/python/sglang/srt/disaggregation/mooncake/conn.py +++ b/python/sglang/srt/disaggregation/mooncake/conn.py @@ -31,7 +31,12 @@ from sglang.srt.disaggregation.base.conn import ( from sglang.srt.disaggregation.mooncake.transfer_engine import MooncakeTransferEngine from sglang.srt.disaggregation.utils import DisaggregationMode from sglang.srt.server_args import ServerArgs -from sglang.srt.utils import get_free_port, get_ip, get_local_ip_by_remote +from sglang.srt.utils import ( + get_free_port, + get_int_env_var, + get_ip, + get_local_ip_by_remote, +) logger = logging.getLogger(__name__) @@ -172,11 +177,9 @@ class MooncakeKVManager(BaseKVManager): # Determine the number of threads to use for kv sender cpu_count = os.cpu_count() self.executor = concurrent.futures.ThreadPoolExecutor( - int( - os.getenv( - "DISAGGREGATION_THREAD_POOL_SIZE", - min(max(1, cpu_count // 8), 8), - ) + get_int_env_var( + "SGLANG_DISAGGREGATION_THREAD_POOL_SIZE", + min(max(1, cpu_count // 8), 8), ) ) elif self.disaggregation_mode == DisaggregationMode.DECODE: @@ -187,11 +190,11 @@ class MooncakeKVManager(BaseKVManager): self.connection_lock = threading.Lock() # Heartbeat interval should be at least 2 seconds self.heartbeat_interval = max( - float(os.getenv("DISAGGREGATION_HEARTBEAT_INTERVAL", 5.0)), 2.0 + float(os.getenv("SGLANG_DISAGGREGATION_HEARTBEAT_INTERVAL", 5.0)), 2.0 ) # Heartbeat failure should be at least 1 self.max_failures = max( - int(os.getenv("DISAGGREGATION_HEARTBEAT_MAX_FAILURE", 2)), 1 + int(os.getenv("SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE", 2)), 1 ) self.start_decode_thread() self.connection_pool: Dict[str, Dict[str, Union[str, int]]] = {}