From 4fe0705abe9bc044ea9223ab71d359f2a5aad66c Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Thu, 6 Nov 2025 19:00:25 +0200 Subject: [PATCH] Fix iqk_mul_mat when number of rows is not multiple of repack rows --- ggml/src/iqk/iqk_mul_mat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml/src/iqk/iqk_mul_mat.cpp b/ggml/src/iqk/iqk_mul_mat.cpp index 44fe0a68..7876d199 100644 --- a/ggml/src/iqk/iqk_mul_mat.cpp +++ b/ggml/src/iqk/iqk_mul_mat.cpp @@ -502,7 +502,8 @@ extern "C" IQK_API bool iqk_mul_mat(long Nx, long Ny, long ne00, auto etypeA = ggml_type(typeA); if (auto dequant_type = MulMat::is_dequant_better(etypeA, Ny); - dequant_type != etypeA && MulMat::prepare(dequant_type, typeB, ne00, mm, Ny)) { + dequant_type != etypeA && MulMat::prepare(dequant_type, typeB, ne00, mm, Ny) && + Nx%MulMat::num_rows(ggml_type(dequant_type)) == 0) { constexpr int k_x_step = 32;