From: Jeff Bolz Date: Wed, 12 Mar 2025 05:59:19 +0000 (-0500) Subject: vulkan: fix bug in coopmat1 mul_mat_id (llama/12316) X-Git-Tag: upstream/0.0.1898~79 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=0c482f7b8eb721f5e00c95a197148b2dddcef47a;p=pkg%2Fggml%2Fsources%2Fggml vulkan: fix bug in coopmat1 mul_mat_id (llama/12316) * tests: run mul_mat_id with a larger N * vulkan: fix bug in coopmat1 mul_mat_id --- diff --git a/src/ggml-vulkan/vulkan-shaders/mul_mm.comp b/src/ggml-vulkan/vulkan-shaders/mul_mm.comp index a8fd93fd..0d03411f 100644 --- a/src/ggml-vulkan/vulkan-shaders/mul_mm.comp +++ b/src/ggml-vulkan/vulkan-shaders/mul_mm.comp @@ -777,7 +777,7 @@ void main() { [[unroll]] for (uint cm_col = 0; cm_col < cms_per_col; cm_col++) { coopMatStore(sums[cm_col * cms_per_row + cm_row], coopmat_stage, warp_i * TM * TN, TM, gl_CooperativeMatrixLayoutColumnMajor); - [[unroll]] for (uint col = 0; col < BN; col += storestride) { + [[unroll]] for (uint col = 0; col < TN; col += storestride) { const uint row_i = dc + cm_col * TN + col + store_c; if (row_i >= _ne1) break; diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index b4e3631e..c86ffb64 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -4113,7 +4113,7 @@ static std::vector> make_test_cases_eval() { for (int n_mats : {4, 8}) { for (int n_used : {1, 2, 4}) { for (bool b : {false, true}) { - for (int n : {1, 32}) { + for (int n : {1, 32, 129}) { int m = 512; int k = 256; test_cases.emplace_back(new test_mul_mat_id(type_a, type_b, n_mats, n_used, b, m, n, k));