feat(offload): warn when streams clamp the group offload blocks

Streamed prefetch runs one block per group, so a larger blocks setting
is reduced to one at apply time. The clamp is now logged once per
component.
This commit is contained in:
CalamitousFelicitousness
2026-09-16 02:18:07 +01:00
parent c3fc8560cb
commit a7d430a8ba
+3
View File
@@ -145,6 +145,9 @@ def apply_group_offload_component(module, module_name: str, main: bool) -> bool:
sig = f'{devices.device}:{main}:' + ':'.join(str(v) for v in cfg.values())
if getattr(module, 'sdnext_group_offload_sig', None) == sig:
return False
requested_blocks = int(shared.opts.group_offload_blocks)
if cfg['use_stream'] and requested_blocks > 1:
log.warning(f'Offload: type=group module={module_name} blocks={requested_blocks} streams=True clamped=1')
if hasattr(module, '_hf_hook'): # leftover accelerate hooks from a previous offload mode abort the group apply upstream
module = accelerate.hooks.remove_hook_from_module(module, recurse=True)
module.sdnext_ondemand = False # group placement replaces any on-demand hook