[Logs Refactor] Optimize shutdown logs, easier to follow and consistent (#43707)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-06-04 14:36:32 -04:00
committed by GitHub
parent 38fd2405f3
commit 41a4829f22
7 changed files with 139 additions and 23 deletions
+6
View File
@@ -2055,6 +2055,10 @@ def destroy_distributed_environment():
def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
logger.debug(
"[shutdown] Distributed: cleanup start shutdown_ray=%s",
shutdown_ray,
)
# Reset environment variable cache
envs.disable_envs_cache()
@@ -2089,6 +2093,8 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
"torch._C._host_emptyCache() only available in Pytorch >=2.5"
)
logger.debug_once("[shutdown] Distributed: cleanup complete")
def in_the_same_node_as(
pg: ProcessGroup | StatelessProcessGroup, source_rank: int = 0