From a4344b545eb9dc4d889c50da8d52500954b2993f Mon Sep 17 00:00:00 2001 From: sudoingX <200180104+sudoingX@users.noreply.github.com> Date: Sat, 19 Sep 2026 07:42:22 +0000 Subject: [PATCH 3/5] Test: add Bonsai 2 projection shapes to the mul_mat perf cases --- tests/test-backend-ops.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index b28bc29ef..955d0d75a 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -10451,6 +10451,23 @@ static std::vector> make_test_cases_perf() { } } + // Ternary Bonsai 2 27B (qwen35): the bf16 gated-delta-net gate projections + for (int bs : {1, 2, 3, 4, 8}) { + test_cases.emplace_back(new test_mul_mat(GGML_TYPE_BF16, GGML_TYPE_F32, 48, bs, 5120, {1, 1}, {1, 1})); // ssm_alpha, ssm_beta + } + + // Ternary Bonsai 2 27B (qwen35, PTQ1_0) projections at speculative-decoding batch sizes + for (int bs : {1, 2, 3, 4, 8}) { + for (ggml_type type_a : {GGML_TYPE_PTQ1_0, GGML_TYPE_Q4_0}) { + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 10240, bs, 5120, {1, 1}, {1, 1})); // attn_qkv + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 6144, bs, 5120, {1, 1}, {1, 1})); // attn_gate + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 5120, bs, 6144, {1, 1}, {1, 1})); // ssm_out + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 17408, bs, 5120, {1, 1}, {1, 1})); // ffn_up, ffn_gate + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 5120, bs, 17408, {1, 1}, {1, 1})); // ffn_down + test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, 12288, bs, 5120, {1, 1}, {1, 1})); // attn_q + } + } + // qwen3-30b-a3b for (int bs : {1, 4, 8, 32, 64, 128, 256, 512}) { for (ggml_type type_a : {GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_Q4_0, GGML_TYPE_Q8_0, GGML_TYPE_Q4_K, GGML_TYPE_Q6_K, GGML_TYPE_IQ2_XS}) { -- 2.34.1