From 95a05ed4da3e093c04bce431b6d9269da1ccaaba Mon Sep 17 00:00:00 2001 From: Jiwoong Song <55657581+jwsong98@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:13:20 +0900 Subject: [PATCH] vulkan: disable large matmul tile on Samsung GPUs with 32KB shared memory (llama/28531) Assisted-by: Claude Opus --- ggml/src/ggml-vulkan/ggml-vulkan-types.h | 3 ++- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan-types.h b/ggml/src/ggml-vulkan/ggml-vulkan-types.h index ee50f51a3..4158ff779 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan-types.h +++ b/ggml/src/ggml-vulkan/ggml-vulkan-types.h @@ -209,6 +209,8 @@ static bool is_pow2(uint32_t x) { return x > 1 && (x & (x-1)) == 0; } #define VK_VENDOR_ID_QUALCOMM 0x5143 +#define VK_VENDOR_ID_SAMSUNG 0x144d + #define VK_DEVICE_DESCRIPTOR_POOL_SIZE 256 #define VK_CHECK(err, msg, dev) \ @@ -1451,4 +1453,3 @@ struct ggml_backend_vk_device_context { std::string pci_bus_id; int op_offload_min_batch_size; }; - diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index a45d5e1f0..033c11741 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -4823,6 +4823,14 @@ vk_device ggml_vk_get_device(size_t idx) { device->mul_mat_id_m[i] = true; device->mul_mat_id_s[i] = !device->coopmat_support; break; + case VK_VENDOR_ID_SAMSUNG: + device->mul_mat_l[i] = false; + device->mul_mat_m[i] = true; + device->mul_mat_s[i] = true; + device->mul_mat_id_l[i] = false; + device->mul_mat_id_m[i] = true; + device->mul_mat_id_s[i] = true; + break; #endif default: device->mul_mat_l[i] = true;