Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-r-o-w committed Jan 10, 2025
1 parent 6a9a3e5 commit c426a34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/diffusers/hooks/group_offloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ def _apply_group_offloading_diffusers_block(

# Always keep parameters and buffers on onload_device
for name, param in module.named_parameters(recurse=False):
param.data = param.data.to(onload_device)
if torch.is_tensor(param.data):
param.data = param.data.to(onload_device)
for name, buffer in module.named_buffers(recurse=False):
buffer.data = buffer.data.to(onload_device)
if torch.is_tensor(buffer.data):
buffer.data = buffer.data.to(onload_device)


def _apply_group_offloading_group_patterns(
Expand Down

0 comments on commit c426a34

Please sign in to comment.