]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
vulkan: enable coopmat2 FA gqa and split_k optimizations more often (llama/12931)
authorJeff Bolz <redacted>
Wed, 16 Apr 2025 18:37:25 +0000 (13:37 -0500)
committerGeorgi Gerganov <redacted>
Thu, 24 Apr 2025 15:36:25 +0000 (18:36 +0300)
commit42a6491c7c2e105fe3ab0acb286c19abbc9a1dfe
treecd6f46c19ab15b70589221e9ecaff665c4388d32
parentfda4f52d525ad7a446e33139b34f072d9eaad082
vulkan: enable coopmat2 FA gqa and split_k optimizations more often (llama/12931)

The grouped query attention optmization doesn't require a power of two ratio,
the only thing relying on it was the modulo operation written as bitwise &.

split_k need not depend on gqa_ratio - enable it any time there's only one
workgroup in the X dimension. The shader gets the split index from the x coord,
and multiple workgroups in the X dimension (pre-split) indicates a larger
FA operation that wouldn't need splitting.
src/ggml-vulkan/ggml-vulkan.cpp
src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp
tests/test-backend-ops.cpp