Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Don't use pytorch attention for head dims above 256 on gfx11 (#17323)

Jukka Seppänenfb3befd16873
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 3d639e099..e33147e74 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -1776,6 +1776,10 @@ def pytorch_attention_enabled():
return ENABLE_PYTORCH_ATTENTION
def pytorch_attention_enabled_vae():
+ if is_amd():
+ arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
+ if arch.startswith("gfx11"): # aotriton ships no head dim > 256 kernels for gfx11 (ROCm/aotriton#168), the VAE's single head needs 384 or 512
+ return False
return pytorch_attention_enabled()
def pytorch_attention_flash_attention():