Compare commits

...

2 Commits

Author SHA1 Message Date
sayakpaul
c86e4b57c9 remove check from ModuleGroup 2025-06-24 14:46:43 +05:30
sayakpaul
0d1cd52e4c raise as early as possible in group offloading 2025-06-24 14:17:37 +05:30

View File

@@ -96,9 +96,6 @@ class ModuleGroup:
else:
self.cpu_param_dict = self._init_cpu_param_dict()
if self.stream is None and self.record_stream:
raise ValueError("`record_stream` cannot be True when `stream` is None.")
def _init_cpu_param_dict(self):
cpu_param_dict = {}
if self.stream is None:
@@ -513,6 +510,9 @@ def apply_group_offloading(
else:
raise ValueError("Using streams for data transfer requires a CUDA device, or an Intel XPU device.")
if not use_stream and record_stream:
raise ValueError("`record_stream` cannot be True when `use_stream=False`.")
_raise_error_if_accelerate_model_or_sequential_hook_present(module)
if offload_type == "block_level":