Skip to content

Commit 1629d93

Browse files
chaunceyjiangnjhill
authored andcommitted
[Bugfix] Disable the statslogger if the api_server_count is greater than 1 (vllm-project#22227)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: Nick Hill <nhill@redhat.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
1 parent c933f05 commit 1629d93

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

vllm/v1/engine/async_llm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def __init__(
143143
engine_idxs=self.engine_core.engine_ranks_managed,
144144
custom_stat_loggers=stat_loggers,
145145
enable_default_loggers=log_stats,
146+
client_count=client_count,
146147
)
147148
self.logger_manager.log_engine_initialized()
148149

vllm/v1/metrics/loggers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ def __init__(
652652
engine_idxs: Optional[list[int]] = None,
653653
custom_stat_loggers: Optional[list[StatLoggerFactory]] = None,
654654
enable_default_loggers: bool = True,
655+
client_count: int = 1,
655656
):
656657
self.engine_idxs = engine_idxs if engine_idxs else [0]
657658

@@ -660,7 +661,12 @@ def __init__(
660661
factories.extend(custom_stat_loggers)
661662

662663
if enable_default_loggers and logger.isEnabledFor(logging.INFO):
663-
factories.append(LoggingStatLogger)
664+
if client_count > 1:
665+
logger.warning(
666+
"AsyncLLM created with api_server_count more than 1; "
667+
"disabling stats logging to avoid incomplete stats.")
668+
else:
669+
factories.append(LoggingStatLogger)
664670

665671
# engine_idx: StatLogger
666672
self.per_engine_logger_dict: dict[int, list[StatLoggerBase]] = {}

0 commit comments

Comments
 (0)