From 8d4a01cbd7d72c443ffacd98cc527950f8cf0792 Mon Sep 17 00:00:00 2001 From: yuhsuan-t <12108766+yuhsuan-t@users.noreply.github.com> Date: Sun, 6 Jul 2025 18:57:27 -0700 Subject: [PATCH] Log the timestamps of each prefill/decode iteration (#6094) Co-authored-by: yuhsuan-t <12108766+yuhsaun-t@users.noreply.github.com> --- python/sglang/srt/managers/scheduler.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py index 7dd17793a..73789dc12 100644 --- a/python/sglang/srt/managers/scheduler.py +++ b/python/sglang/srt/managers/scheduler.py @@ -13,6 +13,7 @@ # ============================================================================== """A scheduler that manages a tensor parallel GPU worker.""" +import datetime import faulthandler import logging import os @@ -1313,10 +1314,12 @@ class Scheduler( f += f"#unbootstrapped-req: {len(self.disagg_prefill_bootstrap_queue.queue)}, " f += f"#queue-req: {len(self.waiting_queue)}, " f += f"#transferring-req: {len(self.disagg_prefill_inflight_queue)}, " - f += f"input throughput (token/s): {self.last_input_throughput:.2f} " + f += f"input throughput (token/s): {self.last_input_throughput:.2f}, " else: f += f"#running-req: {running_bs}, " - f += f"#queue-req: {len(self.waiting_queue)}" + f += f"#queue-req: {len(self.waiting_queue)}, " + + f += f"timestamp: {datetime.datetime.now().isoformat()}" logger.info(f) @@ -1378,7 +1381,8 @@ class Scheduler( msg += ( f"cuda graph: {can_run_cuda_graph}, " f"gen throughput (token/s): {self.last_gen_throughput:.2f}, " - f"#queue-req: {len(self.waiting_queue)}" + f"#queue-req: {len(self.waiting_queue)}, " + f"timestamp: {datetime.datetime.now().isoformat()}" ) logger.info(msg)