mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-13 20:12:30 +08:00
Add detailed multigpu debug logging to load_models_gpu
Amp-Thread-ID: https://ampcode.com/threads/T-019d3f5c-28c5-72c9-abed-34681f1b54ba Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
3fab720be9
commit
20803749c3
@ -780,16 +780,19 @@ def load_models_gpu(models, memory_required=0, force_patch_weights=False, minimu
|
|||||||
if loaded_model_index is not None:
|
if loaded_model_index is not None:
|
||||||
loaded = current_loaded_models[loaded_model_index]
|
loaded = current_loaded_models[loaded_model_index]
|
||||||
loaded.currently_used = True
|
loaded.currently_used = True
|
||||||
|
logging.info(f"[MULTIGPU_DBG] Reusing LoadedModel for {x.model.__class__.__name__}: LoadedModel.device={loaded.device}, model.load_device={loaded.model.load_device}, is_multigpu={getattr(loaded.model, 'is_multigpu_base_clone', False)}, id(patcher)={id(loaded.model)}, id(inner)={id(loaded.model.model)}")
|
||||||
models_to_load.append(loaded)
|
models_to_load.append(loaded)
|
||||||
else:
|
else:
|
||||||
if hasattr(x, "model"):
|
if hasattr(x, "model"):
|
||||||
logging.info(f"Requested to load {x.model.__class__.__name__}")
|
logging.info(f"Requested to load {x.model.__class__.__name__}")
|
||||||
|
logging.info(f"[MULTIGPU_DBG] New LoadedModel for {x.model.__class__.__name__}: LoadedModel.device={loaded_model.device}, model.load_device={x.load_device}, is_multigpu={getattr(x, 'is_multigpu_base_clone', False)}, id(patcher)={id(x)}, id(inner)={id(x.model)}")
|
||||||
models_to_load.append(loaded_model)
|
models_to_load.append(loaded_model)
|
||||||
|
|
||||||
for loaded_model in models_to_load:
|
for loaded_model in models_to_load:
|
||||||
to_unload = []
|
to_unload = []
|
||||||
for i in range(len(current_loaded_models)):
|
for i in range(len(current_loaded_models)):
|
||||||
if loaded_model.model.is_clone(current_loaded_models[i].model):
|
if loaded_model.model.is_clone(current_loaded_models[i].model):
|
||||||
|
logging.info(f"[MULTIGPU_DBG] is_clone match: unloading idx={i}, LoadedModel.device={current_loaded_models[i].device}, model.load_device={current_loaded_models[i].model.load_device}, id(inner)={id(current_loaded_models[i].model.model)}")
|
||||||
to_unload = [i] + to_unload
|
to_unload = [i] + to_unload
|
||||||
for i in to_unload:
|
for i in to_unload:
|
||||||
model_to_unload = current_loaded_models.pop(i)
|
model_to_unload = current_loaded_models.pop(i)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user