[Perf] Move gc.freeze logic from EngineCoreProc to EngineCore for better coverage (#27896)

Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
This commit is contained in:
Jialin Ouyang
2025-11-10 15:34:18 -08:00
committed by GitHub
parent d17ecc6b19
commit b30372cbd0
5 changed files with 30 additions and 14 deletions
+3
View File
@@ -1483,6 +1483,9 @@ def destroy_distributed_environment():
def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
# Ensure all objects are not freezed before cleanup
gc.unfreeze()
destroy_model_parallel()
destroy_distributed_environment()
if shutdown_ray: