From 21370ef7b54faf7e9679e7effe6ec656b9adceed Mon Sep 17 00:00:00 2001 From: Zeyu Li Date: Thu, 20 Nov 2025 12:51:58 +0800 Subject: [PATCH] [UT] Destroy process group after broadcast to resolve port occupation issues in multi-server tests (#12379) --- 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 f2c6e5131..45d2baf84 100644 --- a/test/srt/rl/test_update_weights_from_distributed.py +++ b/test/srt/rl/test_update_weights_from_distributed.py @@ -187,6 +187,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