[ROCm][CI] Stabilize runner teardown between sampler tests (#43023)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-05-23 12:19:54 +08:00
committed by GitHub
parent 367cb81966
commit 6a4723a2e0
2 changed files with 32 additions and 1 deletions
+7 -1
View File
@@ -22,7 +22,10 @@ import zmq
import vllm.envs as envs
from vllm.config import ParallelConfig, VllmConfig
from vllm.distributed import stateless_destroy_torch_distributed_process_group
from vllm.distributed import (
cleanup_dist_env_and_memory,
stateless_destroy_torch_distributed_process_group,
)
from vllm.envs import enable_envs_cache
from vllm.logger import init_logger
from vllm.logging_utils.dump_input import dump_engine_exception
@@ -603,6 +606,9 @@ class EngineCore:
# visible to the garbage collector again. Without this, deleting
# the engine in-process (e.g. unit tests) leaks GPU memory.
gc.unfreeze()
# Tear down distributed state initialized in this EngineCore process
# before it exits and release cached memory.
cleanup_dist_env_and_memory()
def profile(self, is_start: bool = True, profile_prefix: str | None = None):
self.model_executor.profile(is_start, profile_prefix)