[V1][Bugfix]: vllm v1 verison metric num_gpu_blocks is None (#15755)
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import asyncio
|
||||
import contextlib
|
||||
import json
|
||||
import queue
|
||||
import uuid
|
||||
import weakref
|
||||
@@ -362,6 +363,7 @@ class MPClient(EngineCoreClient):
|
||||
executor_class: type[Executor],
|
||||
log_stats: bool,
|
||||
):
|
||||
self.vllm_config = vllm_config
|
||||
# Serialization setup.
|
||||
self.encoder = MsgpackEncoder()
|
||||
self.decoder = MsgpackDecoder(EngineCoreOutputs)
|
||||
@@ -430,14 +432,19 @@ class MPClient(EngineCoreClient):
|
||||
raise RuntimeError("Engine core initialization failed. "
|
||||
"See root cause above.")
|
||||
|
||||
eng_id_bytes, msg = sync_input_socket.recv_multipart()
|
||||
eng_id_bytes, data = sync_input_socket.recv_multipart()
|
||||
eng_id = int.from_bytes(eng_id_bytes, byteorder="little")
|
||||
if eng_id not in identities:
|
||||
raise RuntimeError(f"Unexpected or duplicate engine: {eng_id}")
|
||||
if msg != b'READY':
|
||||
raise RuntimeError(f"Engine {eng_id} failed: {msg.decode()}")
|
||||
message_dict = json.loads(data.decode('utf-8'))
|
||||
if message_dict['type'] != 'READY':
|
||||
raise RuntimeError(f"Engine {eng_id} failed: {data.decode()}")
|
||||
logger.info("Core engine process %d ready.", eng_id)
|
||||
identities.discard(eng_id)
|
||||
# Setup KV cache config with initialization state from
|
||||
# engine core process.
|
||||
self.vllm_config.cache_config.num_gpu_blocks = message_dict[
|
||||
'num_gpu_blocks']
|
||||
|
||||
def _init_core_engines(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user