From 14d1136fe79645af11a019fa88dcaae5337d8b01 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Fri, 14 Jul 2023 18:09:07 +0300 Subject: [PATCH] Fix ipex memstats --- modules/devices.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/devices.py b/modules/devices.py index ba91b8a46..52d6ab627 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -194,14 +194,16 @@ if backend == 'ipex': #Fix functions with ipex torch.cuda.is_available = torch.xpu.is_available torch.cuda.current_device = torch.xpu.current_device + torch.cuda.get_device_name = torch.xpu.get_device_name torch.cuda.get_device_properties = torch.xpu.get_device_properties torch.cuda.empty_cache = torch_gc torch.cuda.memory_stats = torch.xpu.memory_stats - torch.cuda.mem_get_info = lambda device: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_allocated(device)), torch.xpu.get_device_properties(device).total_memory] + torch.cuda.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_allocated(device)), torch.xpu.get_device_properties(device).total_memory] torch.cuda.memory_allocated = torch.xpu.memory_allocated torch.cuda.max_memory_allocated = torch.xpu.max_memory_allocated torch.cuda.reset_peak_memory_stats = torch.xpu.reset_peak_memory_stats + torch.cuda.utilization = 0 torch.cuda.get_rng_state_all = torch.xpu.get_rng_state_all torch.cuda.set_rng_state_all = torch.xpu.set_rng_state_all