Commit eec449ca authored by Simon Lui's avatar Simon Lui
Browse files

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

parent 29ccf9f4
...@@ -488,6 +488,8 @@ def cast_to_device(tensor, device, dtype, copy=False): ...@@ -488,6 +488,8 @@ def cast_to_device(tensor, device, dtype, copy=False):
elif tensor.dtype == torch.bfloat16: elif tensor.dtype == torch.bfloat16:
if hasattr(device, 'type') and device.type.startswith("cuda"): if hasattr(device, 'type') and device.type.startswith("cuda"):
device_supports_cast = True device_supports_cast = True
elif is_intel_xpu():
device_supports_cast = True
if device_supports_cast: if device_supports_cast:
if copy: if copy:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment