]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
vulkan: Support FA with any multiple of 8 head sizes (#15537)
authorJeff Bolz <redacted>
Sun, 24 Aug 2025 09:24:25 +0000 (04:24 -0500)
committerGitHub <redacted>
Sun, 24 Aug 2025 09:24:25 +0000 (11:24 +0200)
commitc9a24fb93208fbbd3da6d903eb75431bfa97e59e
tree6989c5902038221cca528fa86aacab0b69c79396
parenta9c6ffcbfacee092bfaaa400306fceda18199737
vulkan: Support FA with any multiple of 8 head sizes (#15537)

The scalar FA shader already handled multiples of 8. The coopmat1 FA
shader assumed 16x16x16 and the shared memory allocations need the HSK
dimensions padded to a multiple of 16. NVIDIA's coopmat2 implementation
requires multiples of 16 for N and K, and needs the matrix dimensions
padded and loads clamped.

Store the FA pipelines in a map, indexed by the pipeline state.
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_base.comp
ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm1.comp
ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp
tests/test-backend-ops.cpp