From 184f77259c30a6402cb22d21c2dfbc3d144d5093 Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Tue, 23 Jul 2024 10:15:20 -0700 Subject: [PATCH] Update vllm/engine/llm_engine.py --- vllm/engine/llm_engine.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vllm/engine/llm_engine.py b/vllm/engine/llm_engine.py index f981f096e99ca..48d5305892219 100644 --- a/vllm/engine/llm_engine.py +++ b/vllm/engine/llm_engine.py @@ -948,9 +948,10 @@ def do_log_stats( scheduler_outputs: Optional[SchedulerOutputs] = None, model_output: Optional[List[SamplerOutput]] = None) -> None: """Forced log when no requests active.""" - stats = self._get_stats(scheduler_outputs, model_output) - for logger in self.stat_loggers.values(): - logger.log(stats) + if self.log_stats: + stats = self._get_stats(scheduler_outputs, model_output) + for logger in self.stat_loggers.values(): + logger.log(stats) def _get_stats( self,