From 0267fef52a7fade4bd5de05caea0bc8fc8418bf7 Mon Sep 17 00:00:00 2001 From: youkaichao Date: Thu, 28 Mar 2024 17:24:58 -0700 Subject: [PATCH] [Core] fix del of communicator (#3702) --- vllm/model_executor/parallel_utils/pynccl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/parallel_utils/pynccl.py b/vllm/model_executor/parallel_utils/pynccl.py index 968dd7e17d02..ca37d9fe9577 100644 --- a/vllm/model_executor/parallel_utils/pynccl.py +++ b/vllm/model_executor/parallel_utils/pynccl.py @@ -252,5 +252,7 @@ class NCCLCommunicator: assert result == 0 def __del__(self): - dist.destroy_process_group() + # `dist` module might have been already destroyed + if hasattr(dist, 'destroy_process_group'): + dist.destroy_process_group() _c_ncclCommDestroy(self.comm)