Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/diffusers/hooks/group_offloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,12 @@ def apply_group_offloading(
stream = torch.cuda.Stream()
elif hasattr(torch, "xpu") and torch.xpu.is_available():
stream = torch.Stream()
elif hasattr(torch, "npu") and torch.npu.is_available():
stream = torch.npu.Stream()
else:
raise ValueError("Using streams for data transfer requires a CUDA device, or an Intel XPU device.")
raise ValueError(
"Using streams for data transfer requires a CUDA device, an Intel XPU device, or an Ascend NPU device."
)

if not use_stream and record_stream:
raise ValueError("`record_stream` cannot be True when `use_stream=False`.")
Expand Down
Loading