From 8c2134a8755d8a9792af513dab20282affe903e4 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Wed, 14 Oct 2026 12:36:52 +0300 Subject: [PATCH] ggml : add note about mul_mat_id + disable mul_mat_id_dup tests (#30501) --- ggml/include/ggml.h | 5 +++++ tests/test-backend-ops.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ggml/include/ggml.h b/ggml/include/ggml.h index 224bdef92..23ea6437e 100644 --- a/ggml/include/ggml.h +++ b/ggml/include/ggml.h @@ -1497,6 +1497,11 @@ extern "C" { enum ggml_op_hint hint); // indirect matrix multiplication + // + // [TAG_MUL_MAT_ID_DUPLICATE_ID] + // note: this op has undefined behaviour if a given `a` is referenced more than once for a given `b` + // (i.e. duplicate experts per token are not guaranteed to be supported in all backends) + // TODO: add backend support: https://github.com/ggml-org/llama.cpp/pull/29998#issuecomment-6153742533 GGML_API struct ggml_tensor * ggml_mul_mat_id( struct ggml_context * ctx, struct ggml_tensor * as, diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index 3ad705dee..1e95bf50c 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -11028,6 +11028,8 @@ static std::vector> make_test_cases_eval() { test_cases.emplace_back(new test_mul_mat_id(GGML_TYPE_TQ1_0, GGML_TYPE_F32, 28, 10, false, 1024, 1, 4096)); test_cases.emplace_back(new test_mul_mat_id(GGML_TYPE_TQ1_0, GGML_TYPE_F32, 128, 8, false, 1024, 1, 2048)); + // TODO: disabled until CUDA backend support is added [TAG_MUL_MAT_ID_DUPLICATE_ID] +#if 0 // repeated expert ids within a row for (ggml_type ta : {GGML_TYPE_F16, GGML_TYPE_Q8_0, GGML_TYPE_Q4_0}) { for (int n : {9, 16, 33, 64}) { @@ -11039,6 +11041,7 @@ static std::vector> make_test_cases_eval() { test_cases.emplace_back(new test_mul_mat_id_dup(ta, GGML_TYPE_F32, 1025, 10, false, 64, 33, 256, 1.0f, 0, true)); test_cases.emplace_back(new test_mul_mat_id_dup(ta, GGML_TYPE_F32, 2050, 10, true, 64, 33, 256)); } +#endif for (ggml_type type_a : all_types) { test_cases.emplace_back(new test_mul_mat_id(type_a, GGML_TYPE_F32, 4, 2, false, 64, 16, 3*ggml_blck_size(type_a)));