From 73332160c8c9843876680fb04f037793c73d55b6 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 18 Aug 2024 10:29:33 -0400 Subject: [PATCH 1/2] Enable non blocking transfers in lowvram mode. --- comfy/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/ops.py b/comfy/ops.py index 47e8d7a9d..e11d46f9c 100644 --- a/comfy/ops.py +++ b/comfy/ops.py @@ -34,7 +34,7 @@ def cast_bias_weight(s, input=None, dtype=None, device=None): device = input.device bias = None - non_blocking = comfy.model_management.device_should_use_non_blocking(device) + non_blocking = comfy.model_management.device_supports_non_blocking(device) if s.bias is not None: bias = cast_to(s.bias, dtype, device, non_blocking=non_blocking) if s.bias_function is not None: From 6730f3e1a362d5f3ed44f8541517b03356e7bf0e Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Sun, 18 Aug 2024 14:38:09 -0400 Subject: [PATCH 2/2] Disable non blocking. It fixed some perf issues but caused other issues that need to be debugged. --- comfy/ops.py | 1 + 1 file changed, 1 insertion(+) diff --git a/comfy/ops.py b/comfy/ops.py index e11d46f9c..d76138c92 100644 --- a/comfy/ops.py +++ b/comfy/ops.py @@ -21,6 +21,7 @@ import comfy.model_management def cast_to(weight, dtype=None, device=None, non_blocking=False): + non_blocking = False return weight.to(device=device, dtype=dtype, non_blocking=non_blocking) def cast_to_input(weight, input, non_blocking=False):