mirror of
https://github.com/vladmandic/automatic
synced 2026-08-26 15:16:01 +02:00
ROCm enable Dynamic atten only for RDNA2 and older GPUs
This commit is contained in:
@@ -39,15 +39,18 @@ def get_default_modes(cmd_opts, mem_stat):
|
||||
default_diffusers_offload_min_gpu_memory = 0
|
||||
|
||||
default_cross_attention = "Scaled-Dot-Product"
|
||||
|
||||
default_sdp_options = ['Flash', 'Memory', 'Math']
|
||||
default_sdp_override_options = []
|
||||
|
||||
if devices.backend == "zluda":
|
||||
default_sdp_options = ['Math attention', 'Dynamic attention']
|
||||
elif devices.backend in {"rocm", "directml", "cpu", "mps"}:
|
||||
default_sdp_options = ['Flash', 'Memory', 'Math']
|
||||
default_sdp_options = ['Math']
|
||||
default_sdp_override_options = ['Dynamic attention']
|
||||
if devices.backend == "rocm":
|
||||
import torch
|
||||
if int(getattr(torch.cuda.get_device_properties(devices.device), "gcnArchName", "gfx0000")[3:]) < 1100:
|
||||
default_sdp_override_options = ['Dynamic attention'] # only RDNA2 and older GPUs needs this
|
||||
elif devices.backend in {"directml", "cpu", "mps"}:
|
||||
default_sdp_override_options = ['Dynamic attention']
|
||||
else:
|
||||
default_sdp_options = ['Flash', 'Memory', 'Math']
|
||||
|
||||
default_sdp_choices = ['Flash', 'Memory', 'Math']
|
||||
default_sdp_override_choices = ['Dynamic attention', 'CK Flash attention', 'Triton Flash attention', 'Sage attention']
|
||||
|
||||
Reference in New Issue
Block a user