Skip to content

Commit 742b532

Browse files
committed
Fix engine init num_gpu_blocks logging
Avoid exception but still needs more work to be functional with multiple api server procs. Signed-off-by: Nick Hill <nhill@redhat.com>
1 parent c76e8e5 commit 742b532

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

vllm/v1/engine/async_llm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ def __init__(
124124
client_addresses=client_addresses,
125125
client_index=client_index,
126126
)
127-
for stat_logger in self.stat_loggers[0]:
128-
stat_logger.log_engine_initialized()
127+
if self.stat_loggers:
128+
for stat_logger in self.stat_loggers[0]:
129+
stat_logger.log_engine_initialized()
129130
self.output_handler: Optional[asyncio.Task] = None
130131
try:
131132
# Start output handler eagerly if we are in the asyncio eventloop.

vllm/v1/metrics/loggers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ def log(self):
135135
self.spec_decoding_logging.log(log_fn=log_fn)
136136

137137
def log_engine_initialized(self):
138-
logger.info(
139-
"vllm cache_config_info with initialization " \
140-
"after num_gpu_blocks is: %d",
141-
self.vllm_config.cache_config.num_gpu_blocks)
138+
if self.vllm_config.cache_config.num_gpu_blocks:
139+
logger.info(
140+
"Engine %03d: vllm cache_config_info with initialization "
141+
"after num_gpu_blocks is: %d", self.engine_index,
142+
self.vllm_config.cache_config.num_gpu_blocks)
142143

143144

144145
class PrometheusStatLogger(StatLoggerBase):

0 commit comments

Comments
 (0)