Skip to content

Commit 1556468

Browse files
Add a try except block so if torch version is weird it won't crash.
1 parent c6b9c11 commit 1556468

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

comfy/model_management.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,11 @@ def is_nvidia():
224224
torch.backends.cuda.enable_flash_sdp(True)
225225
torch.backends.cuda.enable_mem_efficient_sdp(True)
226226

227-
if int(torch_version[0]) == 2 and int(torch_version[2]) >= 5:
228-
torch.backends.cuda.allow_fp16_bf16_reduction_math_sdp(True)
227+
try:
228+
if int(torch_version[0]) == 2 and int(torch_version[2]) >= 5:
229+
torch.backends.cuda.allow_fp16_bf16_reduction_math_sdp(True)
230+
except:
231+
logging.warning("Warning, could not set allow_fp16_bf16_reduction_math_sdp")
229232

230233
if args.lowvram:
231234
set_vram_to = VRAMState.LOW_VRAM

0 commit comments

Comments
 (0)