ggml-vulkan: gate upstream's tiled concat below one tile, honour the fast-path knob

Upstream #30591 added its own tiled-transpose concat pipelines, selected
for any dim-0 concat whose src1 is transposed. Behind the fork's fast path
(which already takes ne0 >= 32 and honours GGML_VK_CONCAT_FASTPATH) that
selector still caught the decode case (ne0 < 32), bringing back the
decode regression the TILE_DIM gate fixed (FORK.md F3), and
GGML_VK_CONCAT_FASTPATH=0 no longer gave the generic kernel.

Apply the same gate and the knob to upstream's selector.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LumpiastyandClaude Sonnet 5.5 committed 2026-11-22 20:38:33 +01:00
1 parent 86bf601db6
commit cf2790794d
1 file changed
+14
+14
View File
@@ -9749,7 +9749,21 @@ static vk_pipeline ggml_vk_rms_norm_pipeline(const std::array<vk_pipeline, 3> &
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;
}