Unverified Commit 26bd43b5 authored by Nick Hill's avatar Nick Hill Committed by GitHub
Browse files

Revert "[BugFix] Fix engine hanging after KV cache initialization fai… (#36262)

parent 6b625a88
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import contextlib
import os import os
import queue import queue
import signal import signal
...@@ -120,17 +119,9 @@ class EngineCore: ...@@ -120,17 +119,9 @@ class EngineCore:
self._eep_scale_up_before_kv_init() self._eep_scale_up_before_kv_init()
# Setup KV Caches and update CacheConfig after profiling. # Setup KV Caches and update CacheConfig after profiling.
try: num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
num_gpu_blocks, num_cpu_blocks, kv_cache_config = ( vllm_config
self._initialize_kv_caches(vllm_config) )
)
except Exception:
logger.exception(
"EngineCore failed during KV cache initialization; "
"shutting down executor."
)
self.model_executor.shutdown()
raise
vllm_config.cache_config.num_gpu_blocks = num_gpu_blocks vllm_config.cache_config.num_gpu_blocks = num_gpu_blocks
vllm_config.cache_config.num_cpu_blocks = num_cpu_blocks vllm_config.cache_config.num_cpu_blocks = num_cpu_blocks
...@@ -976,49 +967,29 @@ class EngineCoreProc(EngineCore): ...@@ -976,49 +967,29 @@ class EngineCoreProc(EngineCore):
addresses = self.startup_handshake( addresses = self.startup_handshake(
handshake_socket, local_client, headless, parallel_config_to_update handshake_socket, local_client, headless, parallel_config_to_update
) )
exc_during_init = False yield addresses
try:
yield addresses # Send ready message.
except Exception: num_gpu_blocks = vllm_config.cache_config.num_gpu_blocks
exc_during_init = True # We pass back the coordinator stats update address here for the
raise # external LB case for our colocated front-end to use (coordinator
finally: # only runs with rank 0).
if exc_during_init: dp_stats_address = self.frontend_stats_publish_address
# Send FAILED status so the front-end detects init
# failure immediately via ZMQ instead of waiting for # Include config hash for DP configuration validation
# process sentinel (which may be delayed by cleanup). ready_msg = {
with contextlib.suppress(Exception): "status": "READY",
handshake_socket.send( "local": local_client,
msgspec.msgpack.encode( "headless": headless,
{ "num_gpu_blocks": num_gpu_blocks,
"status": "FAILED", "dp_stats_address": dp_stats_address,
"local": local_client, }
"headless": headless, if vllm_config.parallel_config.data_parallel_size > 1:
} ready_msg["parallel_config_hash"] = (
) vllm_config.parallel_config.compute_hash()
) )
else:
# Send ready message.
num_gpu_blocks = vllm_config.cache_config.num_gpu_blocks
# We pass back the coordinator stats update address
# here for the external LB case for our colocated
# front-end to use (coordinator only runs with rank 0).
dp_stats_address = self.frontend_stats_publish_address
# Include config hash for DP configuration validation
ready_msg = {
"status": "READY",
"local": local_client,
"headless": headless,
"num_gpu_blocks": num_gpu_blocks,
"dp_stats_address": dp_stats_address,
}
if vllm_config.parallel_config.data_parallel_size > 1:
ready_msg["parallel_config_hash"] = (
vllm_config.parallel_config.compute_hash()
)
handshake_socket.send(msgspec.msgpack.encode(ready_msg)) handshake_socket.send(msgspec.msgpack.encode(ready_msg))
@staticmethod @staticmethod
def startup_handshake( def startup_handshake(
......
...@@ -1130,11 +1130,6 @@ def wait_for_engine_startup( ...@@ -1130,11 +1130,6 @@ def wait_for_engine_startup(
start_pending[0 if local else 1] -= 1 start_pending[0 if local else 1] -= 1
engine.state = CoreEngineState.READY engine.state = CoreEngineState.READY
elif status == "FAILED":
raise RuntimeError(
f"Engine core {eng_index} reported initialization failure. "
"See root cause above."
)
else: else:
raise RuntimeError( raise RuntimeError(
f"Unexpected {status} message for " f"Unexpected {status} message for "
......
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