[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
+1 -1
View File
@@ -6385,7 +6385,7 @@ class GPUModelRunner(
_ROPE_DICT.clear()
reset_workspace_manager()
if current_platform.is_rocm():
if current_platform.is_rocm() or current_platform.is_xpu():
gc.collect()
torch.accelerator.empty_cache()
torch.accelerator.synchronize()