batch : add n_used count (#14512)

ggml-ci
This commit is contained in:
Georgi Gerganov
2025-07-04 09:04:59 +03:00
committed by GitHub
parent 499a8f5a78
commit c79184d2d1
6 changed files with 34 additions and 1 deletions

View File

@@ -360,6 +360,11 @@ llama_memory_context_ptr llama_kv_cache_unified::init_batch(
ubatches.push_back(std::move(ubatch)); // NOLINT
}
if (balloc.get_n_used() < balloc.get_n_tokens()) {
// failed to find a suitable split
break;
}
auto sinfos = prepare(ubatches);
if (sinfos.empty()) {
break;