From dc02e987641e6d90803f41979f66762bd14f5f95 Mon Sep 17 00:00:00 2001
From: Mike Lothian <mike@fireburn.co.uk>
Date: Wed, 21 Oct 2026 06:32:17 +0100
Subject: [PATCH] vulkan : split the K dimension for 32-64 column mat-mat on
 AMD

ggml_vk_guess_split_k leaves four-wave tile counts unsplit. On RDNA, fill
up to four waves of tiles with split_k for batches of up to 64 columns.
Speculative decoding verification batches of 16 to 60 tokens are 7 to 9%
faster on a Radeon AI PRO R9700, 64 columns and larger are unchanged.

Assisted-by: Claude Code (Claude Sonnet 5.5)
---
 ggml/src/ggml-vulkan/ggml-vulkan.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp
index 6c9a24f7c..4f0af301c 100644
--- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp
+++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp
@@ -6018,6 +6018,9 @@ static uint32_t ggml_vk_guess_split_k(ggml_backend_vk_context * ctx, uint32_t m,
                        m_tiles * n_tiles <= ctx->device->shader_core_count * 4 / 3) {
                 // two waves, the second one at most 1/3 full
                 split_k = 3;
+            } else if (rdna && n <= 64 && m_tiles * n_tiles <= ctx->device->shader_core_count * 4) {
+                // fill up to four waves of tiles for batches that only partly fill one tile column
+                split_k = 4;
             }
             // Cap the split at 8x. Unless k is huge this is a lot of overhead.
             split_k = std::min(split_k, 8u);
-- 
2.56.0

