Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vllm/compilation/collective_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ def __call__(self, graph: fx.Graph):
self.end_and_log()

def __del__(self):
if self.disabled:
if getattr(self, "disabled", True):
return
if flashinfer_comm is not None:
flashinfer_comm.trtllm_destroy_ipc_workspace_for_all_reduce(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,10 @@ def __init__(self, vllm_config: VllmConfig, engine_id: str):

def __del__(self):
"""Cleanup background threads on destruction."""
self._handshake_initiation_executor.shutdown(wait=False)
if self._nixl_handshake_listener_t:
self._nixl_handshake_listener_t.join(timeout=0)
if executor := getattr(self, "_handshake_initiation_executor", None):
executor.shutdown(wait=False)
if listener_t := getattr(self, "_nixl_handshake_listener_t", None):
listener_t.join(timeout=0)

@staticmethod
def _nixl_handshake_listener(metadata: NixlAgentMetadata,
Expand Down Expand Up @@ -1379,4 +1380,4 @@ def reduce(self) -> dict[str, Union[int, float]]:
# TODO: reduce stats to a single value, calculate latency/throughput
return {
"num_successful_transfers": self.data["num_successful_transfers"]
}
}
3 changes: 0 additions & 3 deletions vllm/executor/executor_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ def shutdown(self) -> None:
"""Shutdown the executor."""
self.collective_rpc("shutdown")

def __del__(self):
self.shutdown()
Comment on lines -238 to -239
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executors always have an explicit owner that calls shutdown() so don't need a destructor.


async def execute_model_async(
self,
execute_model_req: ExecuteModelRequest) -> List[SamplerOutput]:
Expand Down
3 changes: 2 additions & 1 deletion vllm/v1/worker/gpu_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ def save_tensorized_model(
tensorizer_config=tensorizer_config, )

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(
Expand Down