Prompt loan: say when a chunk's loan is larger than the auto chunk's (#2090)

This commit is contained in:
Niko1221 committed 2026-10-12 13:20:17 +02:00
1 parent af6affb871
commit 4468e0e62c
1 file changed
+4
+4
View File
@@ -10932,6 +10932,10 @@ int main(int argc, char** argv) {
std::fprintf(stderr, "strata serve: prompt chunk %lld -> %lld tokens for this request: its "
"buffers do not fit the slots that can be lent (#2090)\n", (long long) want,
(long long) want_p);
if (need_p > p.cache->slots() - p.first) // the case that ended the engine before (#2090)
std::fprintf(stderr, "strata serve: the loan for a chunk of %lld tokens (%lld slots) is larger than the "
"auto chunk's (%lld slots): starting it earlier (#2090)\n", (long long) want_p,
(long long) need_p, (long long) (p.cache->slots() - p.first));
const int32_t first = (int32_t) (p.cache->slots() - need_p);
if (want_p != p.sp->chunk() || first != p.first_now) {
if (!p.sp->relayout(want_p, p.cache->device_slot(first), part_bytes(p, first), e)) return false;