diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index ce3a783d5..483141fd2 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -9749,7 +9749,21 @@ static vk_pipeline ggml_vk_rms_norm_pipeline(const std::array & return pipelines[2]; } +// fork: GGML_VK_CONCAT_FASTPATH=0 forces the generic concat kernel (validation / A-B knob, see ggml_vk_concat) +static bool ggml_vk_concat_transpose_enabled() { + static const char * env = getenv("GGML_VK_CONCAT_FASTPATH"); + static const bool off = env != nullptr && std::string(env) == "0"; + return !off; +} + static bool ggml_vk_concat_is_transposed(const vk_device & device, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * dst) { + if (!ggml_vk_concat_transpose_enabled()) { + return false; + } + // below one tile (decode, n_tokens < 32) the tiled path is pure overhead, the generic kernel is faster (FORK.md F3) + if (src1->ne[0] < 32) { + return false; + } if (ggml_get_op_params_i32(dst, 0) != 0) { // dim 0 only return false; }