From: Alberto Cabrera Pérez Date: Wed, 26 Nov 2025 21:14:54 +0000 (+0000) Subject: Fix chunks being too small with small matrix sizes (llama/17526) X-Git-Tag: upstream/0.9.4.395~113 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=c6b3a42cd02d5b248e35fb524c1a2a294e95e2f8;p=pkg%2Fggml%2Fsources%2Fggml Fix chunks being too small with small matrix sizes (llama/17526) --- diff --git a/src/ggml-cpu/repack.cpp b/src/ggml-cpu/repack.cpp index d1321191..875faedf 100644 --- a/src/ggml-cpu/repack.cpp +++ b/src/ggml-cpu/repack.cpp @@ -1731,12 +1731,13 @@ template = min_chunk_size)) { nchunk0 = nth; + dr0 = (nr0 + nchunk0 - 1) / nchunk0; } - const int64_t dr0 = (nr0 + nchunk0 - 1) / nchunk0; - // Ensure nchunk doesn't exceed the number of rows divided by minimum chunk size // This prevents creating too many tiny chunks that could overlap after alignment const int64_t max_nchunk = (nr0 + min_chunk_size - 1) / min_chunk_size;