diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d4ae0edf..f9d3fa8ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,10 @@ - Disabe Dynamic Attention by default on PyTorch 2.7 - Remove GradScaler hijack and use torch.amp.GradScaler instead - **Feature** - - TeaCache support for HiDream I1 + - TeaCache support for HiDream I1 +- **Changes** + - Set the default attention optimizer to Scaled-Dot-Product on all backends + - Enable Dynamic attention for Scaled-Dot-Product with ROCm, DirectML, MPS and CPU backends ## Update for 2025-05-17 diff --git a/modules/shared.py b/modules/shared.py index cdb71534d..c329ef1fb 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -369,18 +369,11 @@ def get_default_modes(): default_offload_mode = "sequential" default_diffusers_offload_min_gpu_memory = 0 - if devices.backend == "directml": # Force BMM for DirectML instead of SDP - default_cross_attention = "Dynamic Attention BMM" if native else "Sub-quadratic" - elif devices.backend == "cpu": - default_cross_attention = "Scaled-Dot-Product" if native else "Doggettx's" - elif devices.backend == "mps": - default_cross_attention = "Scaled-Dot-Product" if native else "Doggettx's" - else: # cuda, rocm, zluda, ipex, openvino - default_cross_attention = "Scaled-Dot-Product" + default_cross_attention = "Scaled-Dot-Product" if devices.backend == "zluda": default_sdp_options = ['Flash attention', 'Math attention', 'Dynamic attention'] - elif devices.backend == "rocm": + elif devices.backend in {"rocm", "directml", "cpu", "mps"}: default_sdp_options = ['Flash attention', 'Memory attention', 'Math attention', 'Dynamic attention'] else: default_sdp_options = ['Flash attention', 'Memory attention', 'Math attention']