]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
vulkan: Use mul_mat_vec_id for small values of n (llama/18918)
authorJeff Bolz <redacted>
Wed, 21 Jan 2026 15:22:02 +0000 (09:22 -0600)
committerGeorgi Gerganov <redacted>
Fri, 30 Jan 2026 13:56:40 +0000 (15:56 +0200)
commit660d943ff8d69398a217fde7a8adf99373556839
treecc79613f7fbff7409050e97d5fa06c8857c987b6
parent924a9e292ca7b818ec93517f83732f89194793df
vulkan: Use mul_mat_vec_id for small values of n (llama/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