]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
Fix garbled output with REPACK at high thread counts (llama/16956)
authorNoah <redacted>
Tue, 4 Nov 2025 05:04:59 +0000 (05:04 +0000)
committerGeorgi Gerganov <redacted>
Sun, 9 Nov 2025 16:30:22 +0000 (18:30 +0200)
commitd7c5e5ac16985acf33ec145ba0a08c98579e8927
tree2965e18af4e7ef0a4acc2e29e753e154bed98847
parentda232870b280eaf79c4af9e595562852233fe375
Fix garbled output with REPACK at high thread counts (llama/16956)

* Fix garbled output with REPACK at high thread counts

Fixed a race condition in the REPACK matrix multiplication code that caused garbled output when using 26+ threads (model-dependent threshold). The issue occurred because with high thread counts, the code forced chunk count to equal thread count, creating many small chunks. After aligning these chunks to NB_COLS boundaries, adjacent chunks could overlap, causing data corruption and race conditions. The fix enforces minimum chunk sizes based on NB_COLS and caps maximum chunk count to prevent creating too many tiny chunks, ensuring proper alignment without overlaps.

* Update ggml/src/ggml-cpu/repack.cpp

Co-authored-by: Georgi Gerganov <redacted>
* Update ggml/src/ggml-cpu/repack.cpp

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
src/ggml-cpu/repack.cpp