Skip to content

Commit f25ea18

Browse files
committed
fix
1 parent ffce2d1 commit f25ea18

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/diffusers/hooks/group_offloading.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ def onload_(self):
107107

108108
def offload_(self):
109109
r"""Offloads the group of modules to the offload_device."""
110-
if self.stream is not None and not self.record_stream:
111-
torch.cuda.current_stream().synchronize()
110+
if self.stream is not None:
111+
if not self.record_stream:
112+
torch.cuda.current_stream().synchronize()
112113
for group_module in self.modules:
113114
for param in group_module.parameters():
114115
param.data = self.cpu_param_dict[param]

0 commit comments

Comments
 (0)