Skip to content

Commit 93c253f

Browse files
committed
Prefix block offload group ids with module prefix
1 parent c82820e commit 93c253f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/hooks/group_offloading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def _apply_group_offloading_block_level(module: torch.nn.Module, config: GroupOf
766766
if len(current_modules) == 0:
767767
continue
768768

769-
group_id = f"{name}_{i}_{i + len(current_modules) - 1}"
769+
group_id = f"{config.module_prefix}{name}_{i}_{i + len(current_modules) - 1}"
770770
group = ModuleGroup(
771771
modules=current_modules,
772772
offload_device=config.offload_device,
@@ -819,7 +819,7 @@ def _apply_group_offloading_block_level(module: torch.nn.Module, config: GroupOf
819819
stream=None,
820820
record_stream=False,
821821
onload_self=True,
822-
group_id=f"{module.__class__.__name__}_unmatched_group",
822+
group_id=f"{config.module_prefix}{module.__class__.__name__}_unmatched_group",
823823
)
824824
if config.stream is None:
825825
_apply_group_offloading_hook(module, unmatched_group, config=config)

0 commit comments

Comments
 (0)