From 89fb9c01178415d6d73535ab033c916475081d8b Mon Sep 17 00:00:00 2001 From: rasbid <104773487+rasbid@users.noreply.github.com> Date: Mon, 13 Oct 2025 20:01:25 +0300 Subject: [PATCH] Tune AMD GCN Vulkan subgroup sizing --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index ebbb412e55f..2a3cb5e5356 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -2319,6 +2319,14 @@ static const std::unordered_map rdna1_pipelines = { {"mul_mat_vec_f16", 32}, {"mul_mat_vec_f32_f16", 32} }; +// Pipeline configuration for GCN GPUs. +static const std::unordered_map gcn_pipelines = { + {"soft_max_back", 64}, {"soft_max", 64}, + {"mul_mat_vec", 64}, {"mul_mat", 64}, + {"argmax", 64}, {"sum_rows", 64}, + {"im2col", 64}, {"flash_attn", 64}, +}; + // Pipeline configuration for RDNA2 GPUs. static const std::unordered_map rdna2_pipelines = { {"soft_max", 64}, {"im2col", 64}, @@ -2328,6 +2336,13 @@ static constexpr uint32_t RDNA_DEFAULT_SUBGROUP_SIZE = 32; // Define configurations for different GPUs. static std::vector gpu_pipeline_configs = { + { + vk_device_architecture::AMD_GCN, + { + gcn_pipelines, + }, + 64, + }, { vk_device_architecture::AMD_RDNA1, {