From f8a4f81f6511d8d912274bf4da60181a58e4cc75 Mon Sep 17 00:00:00 2001 From: Zeyu Li Date: Thu, 30 Oct 2025 13:43:35 +0800 Subject: [PATCH] Destroy process group after broadcast in tests Added cleanup step to destroy the process group after broadcasting. --- test/srt/rl/test_update_weights_from_distributed.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/srt/rl/test_update_weights_from_distributed.py b/test/srt/rl/test_update_weights_from_distributed.py index 37782c397f7a..766a504a55c8 100644 --- a/test/srt/rl/test_update_weights_from_distributed.py +++ b/test/srt/rl/test_update_weights_from_distributed.py @@ -188,6 +188,9 @@ def init_process_hf( print(f"[hf] {rank=} {broadcast_time=:.3f}s") param_queue.put(("broadcast_time", broadcast_time)) + # Destroy process group and release related resource + torch.distributed.destroy_process_group(group) + # Delete the huggingface models to free up memory. del hf_instruct_model del hf_base_model