mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user