]> git.djapps.eu Git - pkg/ggml/sources/ggml/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 11:49:29 +0000 (13:49 +0200)
commit960ee54f175823f4ca0bf8666f8a4234e6764dcd
tree0da25aea42b58b26de1ebe917c7e013b50c27c91
parent0a255263f2497e2b27f3560d3051b153c78d3192
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.
src/ggml-vulkan/ggml-vulkan.cpp
src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.glsl