From 57a03c35f431bd846830781cebc914d8a8ae90fa Mon Sep 17 00:00:00 2001 From: Lei Zhenyuan Date: Mon, 27 Oct 2025 14:12:18 +0800 Subject: [PATCH] fix for intel memory (#3513) --- unsloth/models/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index deaaec26ae..6549280898 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -1014,7 +1014,8 @@ def get_statistics(local_files_only = False): pass _get_statistics(None) _get_statistics("repeat", force_download = False) - vram = torch.cuda.get_device_properties(0).total_memory / 1024 / 1024 / 1024 + total_memory = torch.xpu.get_device_properties(0).total_memory if DEVICE_TYPE == "xpu" else torch.cuda.get_device_properties(0).total_memory + vram = total_memory / 1024 / 1024 / 1024 if vram <= 8 : vram = 8 elif vram <= 16: vram = 16 elif vram <= 20: vram = 20