Fix LLMEngine.del dp_group cleanup condition (#29954)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
This commit is contained in:
Yongtao Huang 2025-12-04 04:14:44 +08:00 committed by GitHub
parent afe9eb408e
commit 2fc5d6e0d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -409,8 +409,6 @@ class LLMEngine:
return self.collective_rpc("apply_model", args=(func,))
def __del__(self):
if (
dp_group := getattr(self, "dp_group", None)
and not self.external_launcher_dp
):
dp_group = getattr(self, "dp_group", None)
if dp_group is not None and not self.external_launcher_dp:
stateless_destroy_torch_distributed_process_group(dp_group)