Revert torch.xpu.mem_get_info

This commit is contained in:
Disty0
2025-02-14 18:04:50 +03:00
parent 1ffa12430c
commit bb8368e52e
+2 -2
View File
@@ -189,8 +189,8 @@ def ipex_init(): # pylint: disable=too-many-statements
torch._C._XpuDeviceProperties.minor = 1
# Fix functions with ipex:
if not hasattr(torch.xpu, "mem_get_info"):
torch.xpu.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_reserved(device)), torch.xpu.get_device_properties(device).total_memory]
# torch.xpu.mem_get_info always returns the total memory as free memory
torch.xpu.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_reserved(device)), torch.xpu.get_device_properties(device).total_memory]
torch.cuda.mem_get_info = torch.xpu.mem_get_info
torch._utils._get_available_device_type = lambda: "xpu"
torch.has_cuda = True