Skip to content

Commit 8fe5a14

Browse files
authored
Raise warning instead of error for block offloading with streams (#11425)
raise warning instead of error
1 parent 58431f1 commit 8fe5a14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/diffusers/hooks/group_offloading.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ def _apply_group_offloading_block_level(
499499
the CPU memory is a bottleneck but may counteract the benefits of using streams.
500500
"""
501501
if stream is not None and num_blocks_per_group != 1:
502-
raise ValueError(f"Using streams is only supported for num_blocks_per_group=1. Got {num_blocks_per_group=}.")
502+
logger.warning(
503+
f"Using streams is only supported for num_blocks_per_group=1. Got {num_blocks_per_group=}. Setting it to 1."
504+
)
505+
num_blocks_per_group = 1
503506

504507
# Create module groups for ModuleList and Sequential blocks
505508
modules_with_group_offloading = set()

0 commit comments

Comments
 (0)