mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix(offload): return on-demand components to rest after bulk moves
A pipeline-level move to the accelerator carries on-demand components along with it, since modular pipelines skip only group-hooked modules; the load path then left a resting vae on the gpu until its first use. Bulk moves now re-evict stamped components, whose entry points onload them when needed.
This commit is contained in:
@@ -266,6 +266,8 @@ def move_model(model, device=None, force=False):
|
||||
model.to(device)
|
||||
if hasattr(model, "prior_pipe"):
|
||||
model.prior_pipe.to(device)
|
||||
if device == devices.device:
|
||||
offload_ondemand(model) # a bulk move must not strand on-demand components on the accelerator; their entry points onload them when needed
|
||||
except Exception as e0:
|
||||
if 'Cannot copy out of meta tensor' in str(e0) or 'must be Tensor, not NoneType' in str(e0):
|
||||
if hasattr(model, "components"):
|
||||
|
||||
Reference in New Issue
Block a user