Allow Intel GPUs to LoRA cast on GPU since it supports BF16 natively.

This commit is contained in:
Simon Lui 2023-09-22 21:11:27 -07:00
parent 29ccf9f471
commit eec449ca8e

View File

@ -488,6 +488,8 @@ def cast_to_device(tensor, device, dtype, copy=False):
elif tensor.dtype == torch.bfloat16:
if hasattr(device, 'type') and device.type.startswith("cuda"):
device_supports_cast = True
elif is_intel_xpu():
device_supports_cast = True
if device_supports_cast:
if copy: