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__(
96
96
else :
97
97
self .cpu_param_dict = self ._init_cpu_param_dict ()
98
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
99
def _init_cpu_param_dict (self ):
103
100
cpu_param_dict = {}
104
101
if self .stream is None :
@@ -513,6 +510,9 @@ def apply_group_offloading(
513
510
else :
514
511
raise ValueError ("Using streams for data transfer requires a CUDA device, or an Intel XPU device." )
515
512
513
+ if not use_stream and record_stream :
514
+ raise ValueError ("`record_stream` cannot be True when `use_stream=False`." )
515
+
516
516
_raise_error_if_accelerate_model_or_sequential_hook_present (module )
517
517
518
518
if offload_type == "block_level" :
You can’t perform that action at this time.
0 commit comments