Skip to content

Commit

Permalink
add third-party device prefix to execution_device (#2612)
Browse files Browse the repository at this point in the history
* add xpu device_map

* fix
  • Loading branch information
faaany authored Apr 9, 2024
1 parent df485ae commit b8c8583
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/accelerate/utils/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ def send_to_device(tensor, device, non_blocking=False, skip_keys=None):
if is_npu_available():
if isinstance(device, int):
device = f"npu:{device}"
else:
raise error
except Exception as error:
if is_xpu_available():
elif is_xpu_available():
if isinstance(device, int):
device = f"xpu:{device}"
else:
Expand Down

0 comments on commit b8c8583

Please sign in to comment.