Skip to content

Commit 3c3eba6

Browse files
committed
account for MPS when available in get_device().
1 parent 9f4d997 commit 3c3eba6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/diffusers/utils/torch_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ def get_device():
175175
return "npu"
176176
elif hasattr(torch, "xpu") and torch.xpu.is_available():
177177
return "xpu"
178+
elif torch.backends.mps.is_available() and hasattr(torch, "mps"):
179+
return "mps"
178180
else:
179181
return "cpu"
180182

0 commit comments

Comments
 (0)