Unverified Commit e680723e authored by Chauncey's avatar Chauncey Committed by GitHub
Browse files

[Bugfix] Disable the statslogger if the api_server_count is greater than 1 (#22227)


Signed-off-by: default avatarchaunceyjiang <chaunceyjiang@gmail.com>
Co-authored-by: default avatarNick Hill <nhill@redhat.com>
parent 620db1fc
......@@ -143,6 +143,7 @@ class AsyncLLM(EngineClient):
engine_idxs=self.engine_core.engine_ranks_managed,
custom_stat_loggers=stat_loggers,
enable_default_loggers=log_stats,
client_count=client_count,
)
self.logger_manager.log_engine_initialized()
......
......@@ -652,6 +652,7 @@ class StatLoggerManager:
engine_idxs: Optional[list[int]] = None,
custom_stat_loggers: Optional[list[StatLoggerFactory]] = None,
enable_default_loggers: bool = True,
client_count: int = 1,
):
self.engine_idxs = engine_idxs if engine_idxs else [0]
......@@ -660,7 +661,12 @@ class StatLoggerManager:
factories.extend(custom_stat_loggers)
if enable_default_loggers and logger.isEnabledFor(logging.INFO):
factories.append(LoggingStatLogger)
if client_count > 1:
logger.warning(
"AsyncLLM created with api_server_count more than 1; "
"disabling stats logging to avoid incomplete stats.")
else:
factories.append(LoggingStatLogger)
# engine_idx: StatLogger
self.per_engine_logger_dict: dict[int, list[StatLoggerBase]] = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment