We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 474a248 commit 7392c8fCopy full SHA for 7392c8f
1 file changed
src/diffusers/hooks/group_offloading.py
@@ -96,9 +96,6 @@ def __init__(
96
else:
97
self.cpu_param_dict = self._init_cpu_param_dict()
98
99
- if self.stream is None and self.record_stream:
100
- raise ValueError("`record_stream` cannot be True when `stream` is None.")
101
-
102
def _init_cpu_param_dict(self):
103
cpu_param_dict = {}
104
if self.stream is None:
@@ -513,6 +510,9 @@ def apply_group_offloading(
513
510
514
511
raise ValueError("Using streams for data transfer requires a CUDA device, or an Intel XPU device.")
515
512
+ if not use_stream and record_stream:
+ raise ValueError("`record_stream` cannot be True when `use_stream=False`.")
+
516
_raise_error_if_accelerate_model_or_sequential_hook_present(module)
517
518
if offload_type == "block_level":
0 commit comments