mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-10 18:05:16 +00:00
Disable bfloat16 on older mac.
This commit is contained in:
parent
0229228f3f
commit
b486885e08
@ -886,14 +886,19 @@ def pytorch_attention_flash_attention():
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def mac_version():
|
||||||
|
try:
|
||||||
|
return tuple(int(n) for n in platform.mac_ver()[0].split("."))
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def force_upcast_attention_dtype():
|
def force_upcast_attention_dtype():
|
||||||
upcast = args.force_upcast_attention
|
upcast = args.force_upcast_attention
|
||||||
try:
|
|
||||||
macos_version = tuple(int(n) for n in platform.mac_ver()[0].split("."))
|
macos_version = mac_version()
|
||||||
if (14, 5) <= macos_version <= (15, 2): # black image bug on recent versions of macOS
|
if macos_version is not None and ((14, 5) <= macos_version <= (15, 2)): # black image bug on recent versions of macOS
|
||||||
upcast = True
|
upcast = True
|
||||||
except:
|
|
||||||
pass
|
|
||||||
if upcast:
|
if upcast:
|
||||||
return torch.float32
|
return torch.float32
|
||||||
else:
|
else:
|
||||||
@ -1034,6 +1039,8 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if mps_mode():
|
if mps_mode():
|
||||||
|
if mac_version() < (14,):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if cpu_mode():
|
if cpu_mode():
|
||||||
|
Loading…
Reference in New Issue
Block a user