From 31e6cfd91b0d75a7af738f35b14da51827a64da7 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Thu, 7 Aug 2025 15:14:45 +0300 Subject: [PATCH] Fix IPEX 2.8 --- modules/intel/ipex/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/intel/ipex/__init__.py b/modules/intel/ipex/__init__.py index 6e1f5047a..f590da35e 100644 --- a/modules/intel/ipex/__init__.py +++ b/modules/intel/ipex/__init__.py @@ -125,6 +125,11 @@ def ipex_init(): # pylint: disable=too-many-statements torch.cuda.Tuple = torch.xpu.Tuple torch.cuda.List = torch.xpu.List + if torch_version < 2.8: + if has_ipex: + torch.cuda.memory_summary = torch.xpu.memory_summary + torch.cuda.memory_snapshot = torch.xpu.memory_snapshot + if torch_version < 2.9: # torch._int_mm via onednn quantized matmul is supported with torch 2.9 # ipex 2.7+ has the same torch._int_mm support as torch 2.9 but doesn't support torch.compile @@ -148,9 +153,6 @@ def ipex_init(): # pylint: disable=too-many-statements torch.xpu.empty_cache = lambda: None torch.cuda.empty_cache = torch.xpu.empty_cache - if has_ipex: - torch.cuda.memory_summary = torch.xpu.memory_summary - torch.cuda.memory_snapshot = torch.xpu.memory_snapshot torch.cuda.memory = torch.xpu.memory torch.cuda.memory_stats = torch.xpu.memory_stats torch.cuda.memory_allocated = torch.xpu.memory_allocated