Skip to content

vulkan: disable flip Flash Attention shader on AMD Windows due to a driver bug - #32415

Merged
ggerganov merged 1 commit into
masterfrom
0cc4m/vulkan-fa-flip-amd-windows
Nov 17, 2026
Merged

ggerganov merged 1 commit into
masterfrom
0cc4m/vulkan-fa-flip-amd-windows

Conversation

@0cc4m

@0cc4m 0cc4m commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Overview

Fixes #32353

The cause is a driver shader compiler bug on AMD Windows (tested on Windows 11, AMD R9700, driver 26.10.1) which crashes when trying to compile specific shaders:

AMD's Windows driver compiler (26.10.1) crashes in vkCreateComputePipelines on a shader that writes a function-local array of cooperative matrices with loop-variable indices in more than one loop, and the flip FA shader does this with every coopmat array it has.

Example reproducer shader:

#version 450
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_control_flow_attributes : enable

layout(local_size_x_id = 0, local_size_y = 1, local_size_z = 1) in;
layout (push_constant) uniform parameter { uint32_t N; } p;
layout (binding = 5) writeonly buffer O {float data_o[];};

#define CM coopmat<float, gl_ScopeSubgroup, 16, 16, gl_MatrixUseAccumulator>

void main() {
    CM a[6];
    for (uint32_t t = 0; t < 4; ++t) { a[t] = CM(0); }
    for (uint32_t t = 4; t < 6; ++t) { a[t] = CM(0); }
    data_o[gl_GlobalInvocationID.x] = float(p.N);
}

@Alex-JP-93 Can you forward this to someone or do you know who I could send it to?

Until that is fixed, disable the flip shader on AMD Windows.

Requirements

@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Nov 16, 2026
hiromimie added a commit to hiromimie/llama.cpp that referenced this pull request Nov 16, 2026
@0cc4m 0cc4m added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Nov 17, 2026
@ggerganov
ggerganov merged commit 8f647f1 into master Nov 17, 2026
31 of 32 checks passed
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Nov 17, 2026
* origin/master: (138 commits)
qwen4exp : fix graph reallocation from the n-gram table scale (ggml-org#32483)
server : return 400 when grammar and ignore_eos are on (ggml-org#32377)
ggml-cuda: disable quantized matvec fusion on all Pascal GPUs (ggml-org#32239)
Title: CUDA: few-row MMQ for MUL_MAT_ID (ggml-org#32065)
ui: turn the live markdown preview off by default (ggml-org#32469)
CUDA: use block reductions for whole-row pool_1d (ggml-org#31855)
ggml : decode F8_E4M3 to fp32 without ldexpf (ggml-org#32477)
llama : keep the k-pool layout prefix on sequence edits (ggml-org#32137)
vocab : speed up PLaMo-2/3 tokenizer table build (ggml-org#32249)
convert : fix FP8 qwen4exp checkpoints (n-gram table scale, block-scaled FP8) (ggml-org#32476)
ui: Llama UI design system: tokens, surfaces and fonts (ggml-org#32468)
mtmd: support Minimax-Music3 (ggml-org#32435)
chat: add tts_dict for kokoro G2P template (ggml-org#32397)
Rotate K/V read order for better L2 cache hit rates (ggml-org#32407)
ui: turn conversation tabs off by default (ggml-org#32402)
ui: move Llama Chat to SvelteKit 3 and its built-in service worker (ggml-org#32463)
qwen3next : apply output projection weight scale (ggml-org#32393)
cuda : raise shared mem limit only for the launched kernel (ggml-org#32392)
nix: expose a SYCL package (ggml-org#31066)
vulkan: disable flip Flash Attention shader on AMD Windows due to a driver bug (ggml-org#32415)
...
dzannotti added a commit to halo-box/strix-llama.cpp that referenced this pull request Nov 17, 2026
Upstream: ggml-org/llama.cpp dde9de8..8f647f1 (1 commits)

Conflicts:
- ggml/src/ggml-vulkan/ggml-vulkan.cpp: kept the fork FA tuning. Upstream ggml-org#32415 disables the flipped FA shader on AMD Windows; the fork does not have that shader (ggml-org#31323 not taken in 78f33fd, Q8), so there is nothing to disable.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YKmjzcT1LTvKtbw9EzBVGE
@Alex-JP-93

Copy link
Copy Markdown
Contributor

@0cc4m OK, I will engage relevant colleagues promptly for issue analysis and root cause investigation.

@0cc4m
0cc4m deleted the 0cc4m/vulkan-fa-flip-amd-windows branch November 18, 2026 04:18
@Alex-JP-93

Copy link
Copy Markdown
Contributor

@0cc4m We have reproduced the issue and tracked down the cause, and a fix is in progress. It should land in an upcoming driver release. Once that driver is out, I will submit a PR to re-enable the FA flip path on AMD Windows.

@0cc4m

0cc4m commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Great, thank you! There's some more code affected in the regular cm1 shader too: #32466

@Alex-JP-93

Copy link
Copy Markdown
Contributor

Great, thank you! There's some more code affected in the regular cm1 shader too: #32466

Okay, we’ll analyze it together.

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

Labels

ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval bug: Vulkan FA prefill crashes in amdvlk64.dll on RDNA3/Windows (flip-direct path from #31323)

4 participants