From aa21c6e3f1ec8587a860d99e806a1342f91388da Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Wed, 24 Dec 2025 22:15:00 +0800 Subject: [PATCH] Super tiny code cleanup (#15652) --- python/sglang/srt/managers/schedule_batch.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/sglang/srt/managers/schedule_batch.py b/python/sglang/srt/managers/schedule_batch.py index 9bd1b62bf..ae9e4a0b1 100644 --- a/python/sglang/srt/managers/schedule_batch.py +++ b/python/sglang/srt/managers/schedule_batch.py @@ -1101,13 +1101,11 @@ class Req: def log_time_stats(self): # If overlap schedule, we schedule one decode batch ahead so this gets called twice. - if self.has_log_time_stats is True: + if self.has_log_time_stats: return - if self.bootstrap_room is not None: - prefix = f"Req Time Stats(rid={self.rid}, bootstrap_room={self.bootstrap_room}, input len={len(self.origin_input_ids)}, output len={len(self.output_ids)}, type={self.time_stats.disagg_mode_str()})" - else: - prefix = f"Req Time Stats(rid={self.rid}, input len={len(self.origin_input_ids)}, output len={len(self.output_ids)}, type={self.time_stats.disagg_mode_str()})" + bootstrap_info = f", bootstrap_room={self.bootstrap_room}" if self.bootstrap_room is not None else "" + prefix = f"Req Time Stats(rid={self.rid}{bootstrap_info}, input len={len(self.origin_input_ids)}, output len={len(self.output_ids)}, type={self.time_stats.disagg_mode_str()})" logger.info(f"{prefix}: {self.time_stats.convert_to_duration()}") self.has_log_time_stats = True