]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
vulkan: Use mul_mat_vec_id for small values of n (#18918)
authorJeff Bolz <redacted>
Wed, 21 Jan 2026 15:22:02 +0000 (09:22 -0600)
committerGitHub <redacted>
Wed, 21 Jan 2026 15:22:02 +0000 (16:22 +0100)
commit50b7f076a55670645525955f54695f1c557c6f6a
tree56ff8196ee4965ad7f7b65cde66819ebc98882ab
parentad8d85bd94cc86e89d23407bdebf98f2e6510c61
vulkan: Use mul_mat_vec_id for small values of n (#18918)

Change ggml_vk_mul_mat_vec_id_q_f16 to loop over the batch dimension and
update the indexing calculations in get_offsets.

Mat-vec is faster than mat-mat for small values of n. We don't get the same
reuse of the weights as in the non-ID path, but with this the cost is linear
in n rather than n>1 being far slower than n==1.
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.glsl