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:
CalamitousFelicitousness
2026-08-08 02:20:06 +01:00
parent abfb5ac3ed
commit cb6e04d392
+2
View File
@@ -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"):