[Core][AMD] Propagate shutdown timeout to MultiprocExecutor (#43154)
Signed-off-by: Ryan Rock <ryan.rock@amd.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
efe7adb5e1
commit
aab639c705
@@ -203,6 +203,7 @@ if TYPE_CHECKING:
|
||||
VLLM_ENFORCE_STRICT_TOOL_CALLING: bool = True
|
||||
VLLM_MQ_MAX_CHUNK_BYTES_MB: int = 16
|
||||
VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS: int = 300
|
||||
VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS: int = 5
|
||||
VLLM_KV_CACHE_LAYOUT: Literal["NHD", "HND"] | None = None
|
||||
VLLM_SSM_CONV_STATE_LAYOUT: Literal["SD", "DS"] | None = None
|
||||
VLLM_COMPUTE_NANS_IN_LOGITS: bool = False
|
||||
@@ -1552,6 +1553,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
|
||||
"VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS": lambda: int(
|
||||
os.getenv("VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS", "300")
|
||||
),
|
||||
# Timeout in seconds for engine and worker process shutdown
|
||||
"VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS": lambda: int(
|
||||
os.getenv("VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS", "5")
|
||||
),
|
||||
# KV Cache layout used throughout vllm.
|
||||
# Some common values are:
|
||||
# - NHD
|
||||
@@ -1994,6 +1999,7 @@ def compile_factors() -> dict[str, object]:
|
||||
"VLLM_ENGINE_ITERATION_TIMEOUT_S",
|
||||
"VLLM_HTTP_TIMEOUT_KEEP_ALIVE",
|
||||
"VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS",
|
||||
"VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS",
|
||||
"VLLM_KEEP_ALIVE_ON_ENGINE_DEATH",
|
||||
"VLLM_IMAGE_FETCH_TIMEOUT",
|
||||
"VLLM_VIDEO_FETCH_TIMEOUT",
|
||||
|
||||
@@ -20,6 +20,7 @@ import msgspec.msgpack
|
||||
import zmq
|
||||
import zmq.asyncio
|
||||
|
||||
from vllm import envs
|
||||
from vllm.config import VllmConfig
|
||||
from vllm.envs import VLLM_ENGINE_READY_TIMEOUT_S
|
||||
from vllm.logger import init_logger
|
||||
@@ -394,7 +395,9 @@ class BackgroundResources:
|
||||
logger.debug_once("[shutdown] MPClient: background resource cleanup start")
|
||||
self.engine_dead = True
|
||||
if self.engine_manager is not None:
|
||||
self.engine_manager.shutdown()
|
||||
self.engine_manager.shutdown(
|
||||
timeout=envs.VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS
|
||||
)
|
||||
if self.coordinator is not None:
|
||||
self.coordinator.shutdown()
|
||||
|
||||
|
||||
@@ -429,7 +429,9 @@ class MultiprocExecutor(Executor):
|
||||
"[shutdown] Executor: waiting for worker exit count=%d",
|
||||
initial_count,
|
||||
)
|
||||
if wait_for_termination(active_procs(), 4):
|
||||
if wait_for_termination(
|
||||
active_procs(), timeout=envs.VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS
|
||||
):
|
||||
logger.info_once("[shutdown] Executor: all workers exited gracefully")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user