File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,6 @@ def __init__(
9696 else :
9797 self .cpu_param_dict = self ._init_cpu_param_dict ()
9898
99- if self .stream is None and self .record_stream :
100- raise ValueError ("`record_stream` cannot be True when `stream` is None." )
101-
10299 def _init_cpu_param_dict (self ):
103100 cpu_param_dict = {}
104101 if self .stream is None :
@@ -513,6 +510,9 @@ def apply_group_offloading(
513510 else :
514511 raise ValueError ("Using streams for data transfer requires a CUDA device, or an Intel XPU device." )
515512
513+ if not use_stream and record_stream :
514+ raise ValueError ("`record_stream` cannot be True when `use_stream=False`." )
515+
516516 _raise_error_if_accelerate_model_or_sequential_hook_present (module )
517517
518518 if offload_type == "block_level" :
You can’t perform that action at this time.
0 commit comments