Skip to content

Commit 450c5c3

Browse files
committed
test-backend-ops: add Bonsai-shape MUL_MAT cases for PTQ1_0/PQ2_0
The stock generator only emits 16 x 256 cases for these types, all of which take the single-column mmvq path, so the multi-column dispatchers (ncols_dst 2..8) had no coverage at all. Add the real Bonsai row lengths (k = 1024/5120/6144/17408) at odd row counts (m = 67/70, landing a partial row group) with n sweeping 1..8. Arc Pro B50, oneAPI 2026.1, Level Zero, per type: MUL_MAT 9 -> 102/102 passed MUL_MAT_ID 75/75 passed
1 parent 8a08dd0 commit 450c5c3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎tests/test-backend-ops.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9301,6 +9301,19 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
93019301
test_cases.emplace_back(new test_mul_mat(GGML_TYPE_Q8_0, GGML_TYPE_F32, 2880, 32, 2880, {1, 1}, {1, 1}));
93029302
test_cases.emplace_back(new test_mul_mat(GGML_TYPE_MXFP4, GGML_TYPE_F32, 2880, 32, 2880, {1, 1}, {1, 1}));
93039303

9304+
// Ternary formats at real Bonsai weight shapes. The k values are the model's actual row
9305+
// lengths and the odd m values land a partial row group; n sweeps 1..8 so the multi-column
9306+
// mmvq dispatchers run, which the 16 x 256 cases above never reach.
9307+
for (ggml_type type_a : {GGML_TYPE_PTQ1_0, GGML_TYPE_PQ2_0}) {
9308+
for (int64_t k : {1024, 5120, 6144, 17408}) {
9309+
for (int64_t m : {67, 70}) {
9310+
for (int64_t n = 1; n <= 8; ++n) {
9311+
test_cases.emplace_back(new test_mul_mat(type_a, GGML_TYPE_F32, m, n, k, {1, 1}, {1, 1}));
9312+
}
9313+
}
9314+
}
9315+
}
9316+
93049317
// m == 1, with n on both sides of MMVF_MAX_BATCH_SIZE (8): mmvf below, operand swap above
93059318
for (int64_t n : {1, 7, 8, 9, 16, 128, 512}) {
93069319
test_cases.emplace_back(new test_mul_mat(GGML_TYPE_F32, GGML_TYPE_F32, 1, n, 2048, {1, 1}, {1, 1}));

0 commit comments

Comments
 (0)