[XPU] Optimize XPU worker shutdown logic to prevent resource leak (#46433)

Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
This commit is contained in:
Chaojun Zhang
2026-06-30 15:27:21 +08:00
committed by GitHub
parent ba22cb6765
commit 8cc242335d
7 changed files with 41 additions and 5 deletions
+4 -3
View File
@@ -1294,10 +1294,11 @@ class Worker(WorkerBase):
# Release kept-alive cumem pools while the pluggable allocator wrappers
# and callbacks are still alive, so MemPool teardown is not deferred to
# interpreter finalization (pytorch/pytorch#145168).
from vllm.device_allocator.cumem import CuMemAllocator
if current_platform.is_cuda_alike():
from vllm.device_allocator.cumem import CuMemAllocator
if CuMemAllocator.instance is not None:
CuMemAllocator.instance.release_pools()
if CuMemAllocator.instance is not None:
CuMemAllocator.instance.release_pools()
def elastic_ep_execute(self, execute_method: str, *args, **kwargs):
return self.elastic_ep_executor.execute(execute_method, *args, **kwargs)