From 61b1d2f6aef8e29c6a0d795a9c6682d525f4d8cc Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 11 Dec 2024 04:26:36 -0500 Subject: [PATCH] [Core] v1: Use atexit to handle engine core client shutdown (#11076) Signed-off-by: Russell Bryant --- vllm/v1/engine/core_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm/v1/engine/core_client.py b/vllm/v1/engine/core_client.py index ee89cece73141..4d96b323d1662 100644 --- a/vllm/v1/engine/core_client.py +++ b/vllm/v1/engine/core_client.py @@ -1,3 +1,4 @@ +import atexit import multiprocessing from typing import List, Union @@ -157,6 +158,7 @@ class MPClient(EngineCoreClient): should_shutdown=self.should_shutdown, **kwargs, ) + atexit.register(self.shutdown) def shutdown(self): # Send shutdown signal to background process.