[ROCm][CI] Stabilize runner teardown between sampler tests (#43023)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user