torch has xpu support in 2.5

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
Wang, Yi A 2024-11-04 18:06:23 -08:00
parent 3d4c50f028
commit 6becab5d3f
1 changed files with 3 additions and 1 deletions

View File

@ -413,7 +413,9 @@ def get_model(
if dtype is None:
if quantize in ["awq", "exl2", "gptq", "marlin"]:
if SYSTEM == "ipex" and not hasattr(torch, "xpu"):
if SYSTEM == "ipex" and not (
hasattr(torch, "xpu") and torch.xpu.is_available()
):
dtype = torch.bfloat16
else:
# These quantizers only work with float16 params.