mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-05 23:02:49 +08:00
Add debug logging for device mismatch in ModelPatcherDynamic.load
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
afdddcee66
commit
3fab720be9
@ -639,6 +639,8 @@ class LoadedModel:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def model_use_more_vram(self, extra_memory, force_patch_weights=False):
|
def model_use_more_vram(self, extra_memory, force_patch_weights=False):
|
||||||
|
if self.device != self.model.load_device:
|
||||||
|
logging.error(f"LoadedModel device mismatch: self.device={self.device}, model.load_device={self.model.load_device}, model_class={self.model.model.__class__.__name__}, is_multigpu={getattr(self.model, 'is_multigpu_base_clone', False)}, id(model)={id(self.model)}")
|
||||||
return self.model.partially_load(self.device, extra_memory, force_patch_weights=force_patch_weights)
|
return self.model.partially_load(self.device, extra_memory, force_patch_weights=force_patch_weights)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
|||||||
@ -1646,6 +1646,8 @@ class ModelPatcherDynamic(ModelPatcher):
|
|||||||
#now.
|
#now.
|
||||||
assert not full_load
|
assert not full_load
|
||||||
|
|
||||||
|
if device_to != self.load_device:
|
||||||
|
logging.error(f"ModelPatcherDynamic.load device mismatch: device_to={device_to}, self.load_device={self.load_device}, model_class={self.model.__class__.__name__}, is_multigpu_base_clone={getattr(self, 'is_multigpu_base_clone', False)}, id(self)={id(self)}")
|
||||||
assert device_to == self.load_device
|
assert device_to == self.load_device
|
||||||
|
|
||||||
num_patches = 0
|
num_patches = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user