Skip to content

Commit 9eca84e

Browse files
committed
fix: Fix confusion on simple vs equal splitting
Branch: GraniteFour Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1 parent b8567ce commit 9eca84e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/llama-kv-cache.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,19 +2538,19 @@ void llama_kv_cache_hybrid::set_full() {
25382538
}
25392539

25402540
llama_sbatch llama_kv_cache_hybrid::sbatch_init(const llama_batch & batch, bool logits_all) {
2541-
// If any of the caches are recurrent, require simple split
2542-
return llama_sbatch(batch, m_hparams.n_embd, m_has_recurrent, logits_all);
2541+
// If any of the caches are recurrent, require equal split
2542+
return llama_sbatch(batch, m_hparams.n_embd, !m_has_recurrent, logits_all);
25432543
}
25442544

25452545
llama_ubatch llama_kv_cache_hybrid::ubatch_next(llama_sbatch & sbatch, uint32_t n_ubatch, bool embd_pooled) const {
2546-
if (m_has_recurrent) {
2547-
return sbatch.split_simple(n_ubatch);
2548-
}
25492546
if (embd_pooled) {
25502547
// Pooled embeddings cannot be split across ubatches (yet)
25512548
return sbatch.split_seq(n_ubatch);
25522549
}
2553-
return sbatch.split_equal(n_ubatch);
2550+
if (m_has_recurrent) {
2551+
return sbatch.split_equal(n_ubatch);
2552+
}
2553+
return sbatch.split_simple(n_ubatch);
25542554
}
25552555

25562556
bool llama_kv_cache_hybrid::find_slot(const llama_ubatch & batch) {

0 commit comments

Comments
 (0)