From e2daeb351cb37a413646aba70b5b03f5a6ff307c Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 6 Oct 2025 15:49:57 -0700 Subject: [PATCH] [Auto Sync] Update test_utils.py (20251006) (#11280) Co-authored-by: github-actions[bot] Co-authored-by: Sehoon Kim --- python/sglang/test/test_utils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index bfe515c15..e6497a52a 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -509,6 +509,7 @@ def popen_launch_server( return_stdout_stderr: Optional[tuple] = None, device: str = "auto", pd_separated: bool = False, + num_replicas: Optional[int] = None, ): """Launch a server process with automatic device detection. @@ -526,7 +527,8 @@ def popen_launch_server( _, host, port = base_url.split(":") host = host[2:] - if pd_separated: + use_mixed_pd_engine = not pd_separated and num_replicas is not None + if pd_separated or use_mixed_pd_engine: command = "sglang.launch_pd_server" else: command = "sglang.launch_server" @@ -540,7 +542,7 @@ def popen_launch_server( *[str(x) for x in other_args], ] - if pd_separated: + if pd_separated or use_mixed_pd_engine: command.extend( [ "--lb-host", @@ -559,6 +561,15 @@ def popen_launch_server( ] ) + if use_mixed_pd_engine: + command.extend( + [ + "--mixed", + "--num-replicas", + str(num_replicas), + ] + ) + if api_key: command += ["--api-key", api_key]