You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apply_group_offloading(use_stream=True) raises on Ascend NPU: no stream branch for torch.npu #14877
apply_group_offloading(..., use_stream=True) in src/diffusers/hooks/group_offloading.py (~line 675) only builds a stream for CUDA (torch.cuda.Stream()) and Intel XPU (torch.Stream()). On every other accelerator it raises:
ValueError: Using streams for data transfer requires a CUDA device, or an Intel XPU device.
Ascend NPU exposes torch.npu.Stream() through torch_npu, so stream-based group offloading is implementable there — but the dispatch never reaches it, making the feature unusable on NPU even though the backend does support streams.
Reproduction
importtorch, torch_npu# Ascend 910Bfromdiffusers.hooksimportapply_group_offloadingprint(torch.cuda.is_available(), torch.xpu.is_available(), torch.npu.is_available())
# False False Trueapply_group_offloading(module, onload_device=torch.device("npu"), use_stream=True)
# ValueError: Using streams for data transfer requires a CUDA device, or an Intel XPU device.
Activity