mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 18:51:31 +00:00
fix wrong print
This commit is contained in:
@@ -382,7 +382,7 @@ class LoadedModel:
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
if not do_not_need_cpu_swap:
|
if not do_not_need_cpu_swap:
|
||||||
real_async_memory = 0
|
memory_in_swap = 0
|
||||||
mem_counter = 0
|
mem_counter = 0
|
||||||
for m in self.real_model.modules():
|
for m in self.real_model.modules():
|
||||||
if hasattr(m, "parameters_manual_cast"):
|
if hasattr(m, "parameters_manual_cast"):
|
||||||
@@ -393,7 +393,7 @@ class LoadedModel:
|
|||||||
m.to(self.device)
|
m.to(self.device)
|
||||||
mem_counter += module_mem
|
mem_counter += module_mem
|
||||||
else:
|
else:
|
||||||
real_async_memory += module_mem
|
memory_in_swap += module_mem
|
||||||
m.to(self.model.offload_device)
|
m.to(self.model.offload_device)
|
||||||
if PIN_SHARED_MEMORY and is_device_cpu(self.model.offload_device):
|
if PIN_SHARED_MEMORY and is_device_cpu(self.model.offload_device):
|
||||||
m._apply(lambda x: x.pin_memory())
|
m._apply(lambda x: x.pin_memory())
|
||||||
@@ -402,11 +402,9 @@ class LoadedModel:
|
|||||||
mem_counter += module_size(m)
|
mem_counter += module_size(m)
|
||||||
print(f"[Memory Management] Swap disabled for", type(m).__name__)
|
print(f"[Memory Management] Swap disabled for", type(m).__name__)
|
||||||
|
|
||||||
if stream.should_use_stream():
|
swap_flag = 'Shared' if PIN_SHARED_MEMORY else 'CPU'
|
||||||
print(f"[Memory Management] Loaded to CPU Swap: {real_async_memory / (1024 * 1024):.2f} MB (asynchronous method)")
|
method_flag = 'asynchronous' if stream.should_use_stream() else 'blocked'
|
||||||
else:
|
print(f"[Memory Management] Loaded to {swap_flag} Swap: {memory_in_swap / (1024 * 1024):.2f} MB ({method_flag} method)")
|
||||||
print(f"[Memory Management] Loaded to CPU Swap: {real_async_memory / (1024 * 1024):.2f} MB (blocked method)")
|
|
||||||
|
|
||||||
print(f"[Memory Management] Loaded to GPU: {mem_counter / (1024 * 1024):.2f} MB")
|
print(f"[Memory Management] Loaded to GPU: {mem_counter / (1024 * 1024):.2f} MB")
|
||||||
|
|
||||||
self.model_accelerated = True
|
self.model_accelerated = True
|
||||||
|
|||||||
Reference in New Issue
Block a user