mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1504] [CLOSED] serve --batch: a layer split reads a prompt in STRATA_SPLIT_PIECE-token runs, decided at every boundary #3494
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#3494
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/1504
Author: @sanastasiou
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:perf/split-read-piece📝 Commits (1)
1730b87serve --batch: a layer split reads a prompt in STRATA_SPLIT_PIECE-token runs, decided at every boundary📊 Changes
5 files changed (+106 additions, -6 deletions)
View changed files
📝
CMakeLists.txt(+4 -0)➕
include/strata/program/read_piece.hpp(+26 -0)📝
src/program/generate.cpp(+15 -3)➕
src/program/read_piece_test.cpp(+46 -0)📝
sycl/src/program/generate.cpp(+15 -3)📄 Description
What
On a layer split under
serve --batch, a prompt read that starts while a batch slot is decoding is cut into single chunks with a decode window between each, because the stage pipeline only overlaps within onesp.run. The read kept that shape to its last chunk, even when the slots finished their short turns a few seconds in. Long reads in a busy server ran at about half the speed of the same read on an idle server.read_partnow decides at every chunk boundary how much to read next (prompt_read_piece/prompt_read_run_endininclude/strata/program/read_piece.hpp):STRATA_SPLIT_PIECEtokens, rounded down to whole chunks (at least one);STRATA_SPLIT_PIECEunset or 0: the whole remaining prompt in one run, as before.The piece size bounds how long a shorter request's
BYIELDwaits behind a long read.Scope: this applies with
--batch-groups 1(the default). With--batch-groups> 1 on a split (piped),read_partstill reads the whole prompt in onesp.run; this PR does not change that path.Default behaviour does not change. With
STRATA_SPLIT_PIECEunset, an idle split reads the whole prompt in one run, the same as today. The only thing that differs without the variable is that a read which started beside a decoding slot goes back to one run once no slot decodes, where today it stayed on single chunks.Measured
2× RTX 3090 layer-split pair (PCIe 3.0, no NVLink), Qwen3.8-Flash-Next IQ3_S,
--batch 2 --prefill auto(8K chunks),STRATA_SPLIT_PIECE=65536. Load: 4 parallel Claude Code compaction benchmarks, each growing to ~400K tokens, through one router onto two such pairs.Over the whole 4×400K run: time to first byte p95 123 s → 76–80 s, mean wall time per conversation 1,260 s → 1,178 s. Recall 5/5 in all four conversations.
Tests
read_piece_test(new, header-only, 15 checks): piece rules, rounding to whole chunks, run end clamped at the prompt end.generate.cppcompiles; ran in production on both pairs.sycl/src/program/generate.cpp: same edit, not compiled (no oneAPI here).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.