mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-23 18:16:01 +08:00
[BugFix] Ensure appropriate guards in destructors (#25284)
Signed-off-by: Nick Hill <nhill@redhat.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
8945b001db
commit
a25ade5d47
@ -1183,7 +1183,7 @@ class AllReduceFusionPass(VllmInductorPass):
|
|||||||
self.end_and_log()
|
self.end_and_log()
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.disabled:
|
if getattr(self, "disabled", True):
|
||||||
return
|
return
|
||||||
if flashinfer_comm is not None:
|
if flashinfer_comm is not None:
|
||||||
flashinfer_comm.trtllm_destroy_ipc_workspace_for_all_reduce(
|
flashinfer_comm.trtllm_destroy_ipc_workspace_for_all_reduce(
|
||||||
|
|||||||
@ -569,9 +569,10 @@ class NixlConnectorWorker:
|
|||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
"""Cleanup background threads on destruction."""
|
"""Cleanup background threads on destruction."""
|
||||||
self._handshake_initiation_executor.shutdown(wait=False)
|
if executor := getattr(self, "_handshake_initiation_executor", None):
|
||||||
if self._nixl_handshake_listener_t:
|
executor.shutdown(wait=False)
|
||||||
self._nixl_handshake_listener_t.join(timeout=0)
|
if listener_t := getattr(self, "_nixl_handshake_listener_t", None):
|
||||||
|
listener_t.join(timeout=0)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _nixl_handshake_listener(metadata: NixlAgentMetadata,
|
def _nixl_handshake_listener(metadata: NixlAgentMetadata,
|
||||||
|
|||||||
@ -235,9 +235,6 @@ class ExecutorBase(ABC):
|
|||||||
"""Shutdown the executor."""
|
"""Shutdown the executor."""
|
||||||
self.collective_rpc("shutdown")
|
self.collective_rpc("shutdown")
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.shutdown()
|
|
||||||
|
|
||||||
async def execute_model_async(
|
async def execute_model_async(
|
||||||
self,
|
self,
|
||||||
execute_model_req: ExecuteModelRequest) -> List[SamplerOutput]:
|
execute_model_req: ExecuteModelRequest) -> List[SamplerOutput]:
|
||||||
|
|||||||
@ -683,7 +683,8 @@ class Worker(WorkerBase):
|
|||||||
tensorizer_config=tensorizer_config, )
|
tensorizer_config=tensorizer_config, )
|
||||||
|
|
||||||
def shutdown(self) -> None:
|
def shutdown(self) -> None:
|
||||||
self.model_runner.ensure_kv_transfer_shutdown()
|
if runner := getattr(self, "model_runner", None):
|
||||||
|
runner.ensure_kv_transfer_shutdown()
|
||||||
|
|
||||||
|
|
||||||
def init_worker_distributed_environment(
|
def init_worker_distributed_environment(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user