Files
diffuse-cpp/src
iafiscal1212andClaude Opus 4.6 d261e604af fix(gqa): use grouped repeat instead of interleaved for GQA heads
ggml_repeat with K[d,4,N]→[d,28,N] gives round-robin head assignment
(kv0,kv1,kv2,kv3,kv0,...) but GQA expects grouped assignment
(kv0×7, kv1×7, kv2×7, kv3×7).

Fix: reshape to 4D, repeat the inner dimension, reshape back.
K[d,kv,N] → K[d,1,kv,N] → repeat → K[d,rep,kv,N] → K[d,head,N]

This was the root cause of garbage output on Dream-7B (GQA 28/4).
LLaDA (MHA 32/32) is unaffected since the GQA path is never taken.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:50:43 +01:00
..