Skip to content

Commit b7a795d

Browse files
committed
update
1 parent 438905d commit b7a795d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/diffusers/hooks/group_offloading.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ def cpu_tensor(t):
207207
for buffer in self.buffers:
208208
if buffer.device.type != "cpu":
209209
buffer.data = buffer.data.cpu()
210-
211-
# Force garbage collection to clean up any released memory
212-
import gc
213-
gc.collect()
210+
# Let Python's normal reference counting handle cleanup
211+
# We don't force garbage collection to avoid slowing down inference
214212

215213
else:
216214
# For non-CPU offloading, synchronize if using stream

0 commit comments

Comments
 (0)