]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
vulkan: Support FA with any multiple of 8 head sizes (llama/15537)
authorJeff Bolz <redacted>
Sun, 24 Aug 2025 09:24:25 +0000 (04:24 -0500)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:03 +0000 (12:54 +0300)
commit11333c210314f9458f677fa2dde0fd63207c5a74
treeef948dd0770e23356a119d4922ef3f803e922456
parent0bbf8a24b0dad351395f960f22747f7938d0be66
vulkan: Support FA with any multiple of 8 head sizes (llama/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.
src/ggml-vulkan/ggml-vulkan.cpp
src/ggml-vulkan/vulkan-shaders/flash_attn_base.comp
src/ggml-vulkan/vulkan-shaders/flash_attn_cm1.comp
src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp
tests/test-backend-ops.cpp