From c550e52f8bcaaafeeaa41e5aac943a767f4d20b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E5=B3=B0?= Date: Thu, 13 Mar 2025 10:29:35 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20scheduler=20proctitle=20suffix=20is=20?= =?UTF-8?q?=E2=80=8B=E2=80=8BNone=20(#4326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wenfeng.wf --- python/sglang/srt/managers/scheduler.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py index 9c42c29f0..445edb10f 100644 --- a/python/sglang/srt/managers/scheduler.py +++ b/python/sglang/srt/managers/scheduler.py @@ -1677,9 +1677,16 @@ def run_scheduler_process( dp_rank: Optional[int], pipe_writer, ): + + # Generate the prefix + if dp_rank is None: + prefix = f" TP{tp_rank}" + else: + prefix = f" DP{dp_rank} TP{tp_rank}" + # Config the process # kill_itself_when_parent_died() # This is disabled because it does not work for `--dp 2` - setproctitle.setproctitle(f"sglang::scheduler_{dp_rank}") + setproctitle.setproctitle(f"sglang::scheduler{prefix.replace(' ', '_')}") faulthandler.enable() parent_process = psutil.Process().parent() @@ -1688,10 +1695,6 @@ def run_scheduler_process( dp_rank = int(os.environ["SGLANG_DP_RANK"]) # Configure the logger - if dp_rank is None: - prefix = f" TP{tp_rank}" - else: - prefix = f" DP{dp_rank} TP{tp_rank}" configure_logger(server_args, prefix=prefix) suppress_other_loggers()