Skip to content

master-964: automatic direct convolution selection (#2134) is ~7x slower end-to-end on RDNA2 (RX 6950 XT, Vulkan) #2137

Closed

Description

@laurentvv

Machine

  • AMD Radeon RX 6950 XT 16 GB (RDNA2 / Navi 21), Windows 11, official sd-master-1d0a58a-bin-win-vulkan-x64.zip release binaries
  • Same-session A/B, idle machine (load gate checked), model file RAM-cached both legs (tensor load 0.2 s on both)

Repro

sd-cli.exe -m juggernautXL_ragnarok.safetensors --steps 20 --cfg-scale 7 \
  --sampling-method euler_a --seed 42 -W 512 -H 512 \
  -o out.png --prompt "a majestic gothic cathedral on a cliff at sunset, highly detailed"
Binary Flags generate_image
master-959 (d637cfb) default 10.9 s
master-964 (1d0a58a) default (auto selections) 73.4 s (6.7x)
master-964 (1d0a58a) --conv-direct off 9.5 s (faster than 959)

Diagnosis

master-964 logs, on this GPU:

[I] flash attention auto: Vulkan0 -> off (probe: normal 0.618 ms, flash 5.565 ms) --- flash_attn.cpp:95
[I] conv2d direct auto: Vulkan0 -> on (implicit GEMM) --- conv_direct.cpp:42
[I] conv3d direct auto: Vulkan0 -> on (implicit GEMM) --- conv_direct.cpp:42

The auto-probe for #2134 selects implicit-GEMM conv2d, but end-to-end that path is
catastrophically slower on RDNA2: forcing --conv-direct off restores (and beats)
master-959 throughput. The isolated per-op probe latency does not predict the full
pipeline behavior on this hardware.

Note: --flash-attn auto -> off seems fine here (9.5 s leg ran with flash off); the
regression is entirely the conv2d/conv3d direct selection.

Suggestion

Consider making the conv-direct auto probe more representative (e.g. timed over a few
layers with realistic tensor sizes, or a short end-to-end warmup), and/or documenting
--conv-direct off as the fallback for RDNA2 in the README while the probe is tuned.

Happy to test candidate fixes on this GPU.

Activity

  1. laurentvv commented on Oct 15, 2026

    @laurentvv
    Author

    Draft comment for leejet/stable-diffusion.cpp #2137 (conv-direct RDNA2 regression)

    Posting = user GO (precedent: #1976 datapoints 10-08/10-12/10-14, #2137 opening 10-14).
    Sanitize: no local paths.


    Fixed on master-968 (8cd731e) — #2141 benchmarks the direct convolution in auto mode and now rejects it on RDNA2. Thank you.

    Datapoint (same machine as the issue: RX 6950 XT, Windows, official sd-master-*-bin-win-vulkan-x64.zip binaries, SDXL 512×512 20 steps cfg 7 seed 42, same-session A/B, model RAM-cached):

    build wall (2nd run, warm cache) conv-direct auto decision
    master-959 (d637cfb) 10.9 s (no auto selection — pre-#2134)
    master-964 (1d0a58a) 73.4 s conv2d direct auto: Vulkan0 -> on (implicit GEMM — ~7× slower end-to-end)
    master-968 (8cd731e) 9.9 s (generate_image completed in 9.52s) conv2d direct auto: Vulkan0 -> off (probe output check failed) + same for conv3d

    The output-check added by #2141 catches the bad probe on this GPU and auto falls back to the correct path — no --conv-direct off override needed anymore. Flash-attn auto→off remains correct (probe: normal 0.673 ms vs flash 5.600 ms).

    Qwen-Image-2.1-Turbo real path (workflow, 1152×640, 8 steps) also re-validated on 968: exit 0, 123 s wall (959 reference ~112 s gen — parity), render visually clean.

    From our side #2137 can be closed as fixed by #2141.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions