Skip to content

Log the timestamps of each prefill/decode iteration #6094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 7, 2025
10 changes: 7 additions & 3 deletions python/sglang/srt/managers/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# ==============================================================================
"""A scheduler that manages a tensor parallel GPU worker."""

import datetime
import faulthandler
import logging
import os
Expand Down Expand Up @@ -1313,10 +1314,12 @@ def log_prefill_stats(
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)

Expand Down Expand Up @@ -1378,7 +1381,8 @@ def log_decode_stats(
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)
Expand Down
Loading