From d54b58cc4880ba45bc6d2c56b555d68634f6498c Mon Sep 17 00:00:00 2001 From: liuzhenwei Date: Thu, 6 Aug 2026 10:27:57 +0800 Subject: [PATCH] =?UTF-8?q?[Hardware]=20Use=20torch.accelerator.empty=5Fho?= =?UTF-8?q?st=5Fcache()=20for=20host=20cache=20cl=E2=80=A6=20(#51107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhenwei-intel --- vllm/distributed/parallel_state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/distributed/parallel_state.py b/vllm/distributed/parallel_state.py index 1b45692453..149de9150d 100644 --- a/vllm/distributed/parallel_state.py +++ b/vllm/distributed/parallel_state.py @@ -2154,10 +2154,10 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False): if not current_platform.is_cpu(): torch.accelerator.empty_cache() try: - torch._C._host_emptyCache() + torch.accelerator.empty_host_cache() except AttributeError: logger.warning( - "torch._C._host_emptyCache() only available in Pytorch >=2.5" + "torch.accelerator.empty_host_cache() only available in Pytorch >=2.9" ) logger.debug_once("[shutdown] Distributed: cleanup complete")