MCPcopy Create free account
hub / github.com/huggingface/diffusers / _apply_group_offloading

Function _apply_group_offloading

src/diffusers/hooks/group_offloading.py:706–712  ·  view source on GitHub ↗
(module: torch.nn.Module, config: GroupOffloadingConfig)

Source from the content-addressed store, hash-verified

704
705
706def _apply_group_offloading(module: torch.nn.Module, config: GroupOffloadingConfig) -> None:
707 if config.offload_type == GroupOffloadingType.BLOCK_LEVEL:
708 _apply_group_offloading_block_level(module, config)
709 elif config.offload_type == GroupOffloadingType.LEAF_LEVEL:
710 _apply_group_offloading_leaf_level(module, config)
711 else:
712 assert False
713
714
715def _apply_group_offloading_block_level(module: torch.nn.Module, config: GroupOffloadingConfig) -> None:

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…