Commit 2cff104
llama : align KV cache tensor-split granularity to cache block size
When a quantized KV cache is used with SPLIT_MODE_TENSOR the per-device
slice size must be a multiple of the cache type's block size (e.g. 32 for
Q4_0). Previously the granularity was derived solely from the weight
tensor's block size (1 for F16), which happened to satisfy the constraint
only when n_embd_head_k was already a multiple of the KV block size.
Make the alignment explicit by taking the lcm of granularity_kv and
ggml_blck_size(tensor->type) for cache tensors. For F16/BF16 cache
(blck_size=1) the behaviour is unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f0d252b commit 2cff104
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
596 | | - | |
| 595 | + | |
597 | 596 | | |
598 | 597 | | |
599 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
600 | 606 | | |
601 | 607 | | |
602 | 608 | | |
| |||
0 commit comments