Merge branch 'comfyanonymous:master' into master

This commit is contained in:
patientx 2025-02-16 14:37:41 +03:00 committed by GitHub
commit 45c55f6cd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1107,6 +1107,11 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma
if is_ascend_npu():
return True
if is_amd():
arch = torch.cuda.get_device_properties(device).gcnArchName
if arch in ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012", "gfx906", "gfx900", "gfx803"]: # RDNA2 and older don't support bf16
return False
props = torch.cuda.get_device_properties(device)
if props.major >= 8:
return True