]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vulkan: Workaround compiler bug in conv2d coopmat2 path (#24924)
authorJeff Bolz <redacted>
Fri, 26 Jun 2026 09:53:32 +0000 (04:53 -0500)
committerGitHub <redacted>
Fri, 26 Jun 2026 09:53:32 +0000 (11:53 +0200)
* vulkan: Workaround compiler bug in conv2d coopmat2 path

* apply same workaround to CONV_3D

* Apply suggestion from @jeffbolznv

ggml/src/ggml-vulkan/vulkan-shaders/conv2d_mm.comp
ggml/src/ggml-vulkan/vulkan-shaders/conv3d_mm.comp
tests/test-backend-ops.cpp

index 1428ef68d81ca787f29c4ceae606b8a6118a715a..99400098bf2b708d59b414b1ec1749990d278911 100644 (file)
@@ -158,7 +158,7 @@ const uint32_t Csh_stride = BS_NPQ;
 #ifdef COOPMAT
 const uint32_t Csh_len    = BS_K * Csh_stride;
 #else
-const uint32_t Csh_len    = csh_store != 0 ? BS_K * Csh_stride : 1;
+const uint32_t Csh_len    = csh_store != 0 ? BS_K * Csh_stride : 8; // 8 to workaround compiler bug
 #endif
 shared SHMEM_TYPE Csh[Csh_len];  // K x NPQ
 #endif
index a9712eb3acfce3d95dc7af43ca9424393c6f0d52..f66f299f6dae4d1c7ae1139e8fb580292dae77d4 100644 (file)
@@ -144,7 +144,7 @@ const uint32_t Csh_stride = BS_NPQ;
 #ifdef COOPMAT
 const uint32_t Csh_len    = BS_K * Csh_stride;
 #else
-const uint32_t Csh_len    = csh_store != 0 ? BS_K * Csh_stride : 1;
+const uint32_t Csh_len    = csh_store != 0 ? BS_K * Csh_stride : 8; // 8 to workaround compiler bug
 #endif
 shared SHMEM_TYPE Csh[Csh_len];  // K x NPQ
 #endif
index 0a017d57e718d0d129a1630b9fc91d9d8ca74a12..0830dbf57000d49d3728390d39c347e5d262f761 100644 (file)
@@ -7973,6 +7973,9 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
             }
         }
     }
+    for (auto kernel_type : {GGML_TYPE_F32, GGML_TYPE_F16}) {
+        test_cases.emplace_back(new test_conv_2d({ 256, 256, 192, 1 }, { 3, 3, 192, 96 }, kernel_type, 1, 1, 1, 1, 1, 1, false));
+    }
 
     // sycl backend will limit task global_range < MAX_INT
     // test cases for 2D im2col with large input W and H (occurs in stable-diffusion)