mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4927] [Engine] KVA with batch slots: allow KVA and read cold batch prompts in one run #2263
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bayerhazard on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4927
Short
KVA is disabled whenever
--batch/parallelslots are used. This change enables KVA for batch serving and reads a cold KVA prompt in one run; on our 24 GB RTX 5090 Laptop it cuts 70K/190K prompt TTFT from 22.5 s to 19.1 s. This is the simple form for long solo prompts; a concurrent second request has to wait (see #4930 for the interleaved form).Our system
parallel: 2,--prefill auto:32768, KVA split 36 / suffix 2048, MTP--spec 6, engine 0.1.55 (Strata 0.2.9).The solution
Two small changes in
src/program/generate.cppagainst v0.2.9:else if (o.batch > 0) ke.blocked = "batch slots (--batch)";line;pos0 == 0, long enough, one GPU), read that part in one run instead of splitting it withbatch_read_piece, and skip theread_windowspath for it. The internal prefill chunking still applies; KVA sees the full part length.Branch: https://git.aimighty.olares.de/aimighty/strata/src/branch/kva-batch-029/src/program/generate.cpp
Diff: 8 insertions, 3 deletions in one file.
What it brings
tools/batch_test.py, 40K prompt, greedy (temperature=0 top_k=1),--adapt-every 1000000 --pcie-frac 0: KVAapproximated 32768 of 38914 positions; solo and batch long output identical.Limits
Request
Please consider adopting KVA+batch upstream. #4930 is the interleaved follow-up and the preferred form for
parallelslots; this issue documents the simple first step. I can open a PR and run the required CUDA/HIP/SYCL builds/tests.@bayerhazard commented on GitHub (Nov 1, 2026):
Follow-up for the multi-request cost of the whole-prompt read: #4930. Interleaved variant measured on the same box: long 100K request 38.19 s (KVA off 43.62), short 25K request 16.59 s (whole-prompt 37.12, KVA off 18.35). The initial simple version in this issue is fine for solo long prompts; #4930 is the preferred form for parallel slots.