mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4198] [CLOSED] [Docs] design for batched decoding in the DeepSeek-V4.1 engine #4943
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#4943
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4198
Author: @suifei
Created: 10/26/2026
Status: ❌ Closed
Base:
main← Head:docs/dsv41-batching-design📝 Commits (1)
77b083edocs(dsv41): design for batched decoding (continuous batching)📊 Changes
1 file changed (+115 additions, -0 deletions)
View changed files
➕
docs/DSV41_BATCHING.md(+115 -0)📄 Description
Problem and result
Three concurrent requests to a
deepseek41server take the sum of the three:strata-dsv41 --servereads one request at a time (GEN/GENI/STOP/QUIT), the model holds one conversation, and the server queues behind one FIFO. The engine'sslotsare conversations saved to disk and restored (a context switch), not parallel decoding, and--parallelis ignored with a warning.Measured on 4 x L20 (2.25 bpw, 1M context): one 300-token answer ~5 s (65 tok/s); three 150-token answers sent together ~6.5-21 s; a 6.6K-token cold prompt ~9.6 s (654-690 tok/s prefill). Aggregate throughput stays at one request's worth however many clients wait.
This PR adds the design for continuous batching in that engine: per-sequence state and paged KV, a scheduler, varlen attention, a batched MoE, the protocol and server changes, milestones, memory numbers, and what helps today without engine work. No behaviour changes - documentation only.
Related discussion
None yet. Per CONTRIBUTING this is a substantial feature, so this draft is a proposal for scope; the code would follow M1-M4 in the document, and I am happy to turn it into an issue first or to start with the smallest useful slice (decode-only batching, prefill still one sequence at a time).
Approach
The document scopes the work in four milestones, cheapest first:
SeqState+ scheduler loop (one kernel call per sequence per step): plumbing, no speedup yet.ds4_attn_split.cuh,ds4_kernels.cu).ds4_iq.cu,ds4_tq.cu).GEN <seq> ...,STOP <seq>) and server streaming for N in-flight requests.Expected shape from the measurements: three answers finish in roughly the time of one (+20-40 %) instead of 3x, per-sequence decode ~45-55 tok/s, aggregate 135-165 tok/s. Single-request latency does not improve.
Validation
Documentation-only change, so no GPU builds were run for it. The numbers quoted come from the deployment that motivated it (4 x NVIDIA L20, driver 595.71, CUDA 13.2,
strata-dsv410.1.51, IST-DAS 2.25 bpw pack, 1M context):Passed:
python -m unittest serve.test_dsv41- 60 tests, OK (skipped=1), the tree this document describes.POST /v1/chat/completionswith 1 and 3 concurrent clients (Python threads),temperature: 0,reasoning_effort: none.Failed:
none observed.
Not run:
Limits
The design does not touch the kernels yet, and the effort estimate for M2-M3 (4-8 weeks for an experienced CUDA engineer) is the author's estimate, not a measurement. The first useful version is likely decode-only batching with prefill still one sequence at a time; the document says so and lists the open questions (DSpark in a batch,
--parallelownership, preemption).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.