We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 438905d commit b7a795dCopy full SHA for b7a795d
src/diffusers/hooks/group_offloading.py
@@ -207,10 +207,8 @@ def cpu_tensor(t):
207
for buffer in self.buffers:
208
if buffer.device.type != "cpu":
209
buffer.data = buffer.data.cpu()
210
-
211
- # Force garbage collection to clean up any released memory
212
- import gc
213
- gc.collect()
+ # Let Python's normal reference counting handle cleanup
+ # We don't force garbage collection to avoid slowing down inference
214
215
else:
216
# For non-CPU offloading, synchronize if using stream
0 commit comments