mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2275] [Engine] [Direction] Aim Strata at long-context multi-user: a peer's prompt read leaves a decoding slot at 3.67 tok/s, the batch window emits 1 token/slot, and 4 streams take 4.04x a single read to their first tokens (2x2080 Ti layer s… #913
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#913
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 @superniker on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2275
Reopen checklist (retested on 0.2.0-beta)
serve/server.pyfrom v0.1.45 plus the released engine packagestrata-engine-0.1.45.3-linux-x86_64-cuda-cuda13(strata 0.1.45, 65sm_75cubins). No engine build was needed.STRATA_PIPED_CONCURRENT=1measures identical with and without it in every shape we can run, and the engine refuses it beside our expert source by design (details in the first comment).strata --serve --pack … --native … --ple-gguf … --expert-profile … --expert-cache auto --prefill auto:32768 --spec 4 --spec-min-p 0.5 --mtp … --max-context 262144 --kv int8 --kv-resident 65536 --remote-expert-opt --pipeline-windows 2 --batch 4 --batch-mtp --layer-split 24, then four concurrent 78,653-token prompts (ignore_eos, 256 tokens, a unique salt per stream, temperature 0, streaming).0.2.0-beta(engine0.1.45.3), Linux 7.0.0-38--kv-resident 65536,--spec 4 --spec-min-p 0.5, MTP drafts fromdata/mtp/rt,--batch 4,--batch-groups auto(the engine logs "2 groups of 2 slots")runs020/<stamp>/logs/) and can be attached on request.This is a direction request, not a bug report
We would like Strata aimed at long-context multi-user serving: several 96K–192K conversations on one engine, all of them making progress, each keeping a usable tok/s, and nobody waiting for a peer's whole prompt to be read. Today that is not the case on a 2-GPU layer split, and the two gaps we measured look structural rather than tuning: they are the two core assumptions of the current design, and we are willing to test whatever you think should change first.
What we are asking for (design direction)
stages.empty()) is the biggest lever we found.server.py: "one prompt read at a time"), so n streams cost n(n+1)/2 read times to reach their first tokens (4 streams at 96K: 412 s).Summary of the evidence
On a 2×RTX 2080 Ti layer-split rig running Qwen3.8-Flash-Next IQ3_XXS at 96K–192K context we measured the multi-user path end to end. Two losses dominate:
We are not asking for a patch. We are asking whether "long-context multi-user on a layer split" is a direction you would take, and we offer to run any A/B on this rig.
Rig and flags
--batch 4 --batch-groups auto→ 2 groups of 2 slots;--batch-mtprefused: "it is not run with helper expert caches on a layer split";--remote-expert-opt;--pipeline-windows 2(off: "not with --batch slots")--kv int8 --kv-resident 65536,--max-context 262144; prompt chunk auto 26 624 tokens (384-slot ring); PLEdirect(startup probe 69 943–75 741 rows/s, "fine")What we measured
Single stream (references): 96K prefill 1 555 tok/s, decode ~135 tok/s (drafts accepted 147/179); 192K prefill 1 600 tok/s, decode 121 tok/s.
Two streams, 96K, MT=256 (unique nonces ⇒
reused 0):Four streams, 96K, MT=64: TTFT 51.1 / 102.9 / 154.6 / 206.4 s (sum 412 s, the reads are fully serialized), all four finish at 209.4 s.
Where a window's time goes (
STRATA_DECODE_TIMING=1): 20.35–43.65 ms/window =verify 20.33–37.98(GPU-reach wait 8.11–8.28+per-layer host 0.76–1.37[CPU 3.64–5.71] +stage 0.01–0.09) +commit/emit 0.01; per layer-windowCPU experts 0.94–1.50,VRAM hits 8.23–9.04,PCIe 0.02–0.27.stageis 0.01–0.09 ms, so we do not have the #2038 launch-serialization regression — we checked before reporting this.dmon (106 s, 1 Hz): SM mean 68.1 % / 67.1 %, 26 % / 24 % of samples ≤ 5 %, PWR mean 209 W / 204 W (max 305/300; TDP 250). "Only one card above 20 %" in 52 of 106 seconds. There is GPU headroom; the contended resource looks like the per-window host/PCIe/expert orchestration.
Why the two losses look structural
batch_read_piece()returns 0 for the pipelined groups (include/strata/program/batch_read.hpp:24), so on our route the read is onesp.runand — because of the earlyif (piece <= 0) return sp.run(...)insrc/program/generate.cpp(~line 10907) — the decode-share block and the BYIELD point below it are unreachable.STRATA_BATCH_DECODE_SHAREis therefore inert by construction here (we verified: 0.5 / 1.0 / 3.0 all give the same 2.0 s of slot decoding per read on the one route where it is reachable, and 0 on ours).--batch-mtpcannot run on a split (generate.cpp:4362–4374): it needs--batch ≥ 2,--mtp,--spec ≥ 2, its own GPU per stage, not--batch-groups > 1, and not helper expert caches /--remote-expert-opt. We hit the last two. Your 2×A4000 numbers (x4 aggregate 85.8 pipelined without batch-mtp vs 64.1 serial with it) say the pipelined groups are the right trade — which is why we are not asking to "just enable batch-mtp"; the batch window needs a way to draft inside the pipelined groups.We ported PR #2050 to our tree and measured it
The mechanism works: with
STRATA_PIPED_READ_PIECE=26624, the log showsa read right after a read: the slots decoded 253 rows in 8398 ms first, and 2-chunk pieces read at 1 589 tok/s (no read-speed loss).But on our rig it does not pay, and the reason is a number we would like to understand better:
The granularity is forced: a piece must be a whole prompt chunk, and our chunk is 26 624 tokens (sized by the expert cache: 29 952 is refused because CUDA1's 6 790 slots cannot hold the borrow). One piece is therefore ~21 s of reading, so "giving way once" costs the joiner ~20 s. On rigs whose chunk is a few thousand tokens the same switch is nearly free.
What we ruled out on this rig (so it is not a config report)
--pcie-frac 0.55vs the auto refinement (0.17 / 0.32): identical (walls 104.9 / 109.6 s, 8.8 rows/s both); the two-card alternation is unchanged (51 % vs 49 % of seconds)--kv-resident 131072(KV block VRAM hit 52 % → 96.67 %): decode unchanged (2.4 rows/s), read slightly faster--batch 2("2 groups of 1 slot") and--batch 4 --batch-groups 4("4 groups of 1 slot"): identical TTFT/wall to--batch 4 --batch-groups auto--batch-groups 1, removing--pipeline-windows 2: identical--mmap-experts(resident arena off): RSS 60.8 → 48.4 GB but read −13 % and decode −17 % — a memory trade, not a speed one--ple-inflight 1024(1 564.7 tok/s),--ple-row-cache 8M(1 558.1),--no-ple-prefetch(1 556.1),--ple-io mmap(1 396–1 541) vs default 1 554;--ple-delay-us 200and 5000 had no effect at all (5 000 µs/row would be 240 ms/token, so we suspect the injector does not engage on this build — worth a look, it would be a useful instrument)STRATA_ADMISSION_RR=1, our own local experiment): it does make the two first tokens arrive together, but the sum of first-token times goes 153 s → 238 s (2 chunks) / 290 s (1 chunk)The asks (design direction, not a patch request)
Prefill::run(tokens, n, pos0)is one contiguous range and oneSessionState; with 2 streams the TTFT sum is already 2.0× the single read and with 4 streams 4.04× (412 s). Making it n× instead of n(n+1)/2 is the fairness half of the problem; we have a costed change list for our tree if you want to compare approaches.We can run any A/B you specify on this rig (sm_75, 2×11 GB, long context, IQ3_XXS) and report numbers in your format. We are not expecting all three; we would like to know which one you consider the real bottleneck.
Related issues and why they do not cover this rig
--batch-groupson 2×3080 20 GB; our 3.67 tok/s matches its 3.7–13 tok/s, so this is not rig-specific. #2050 is its fix and is opt-in.running: 0 / queued: 0); we hit a sibling of this once when we tried to force pieces with the normal admission (a request produced no tokens). Worth knowing: it reproduces whenbatch_read_pieceis made to return >0 on the pipelined route without #2050'spump/pipe_drainpairing.stageis 0.01–0.09 ms (no launch serialization), and our groups are "2 groups of 2 slots" (not the "1 group of N" trap).Thanks — the single-stream path on this rig is genuinely good (1 555 tok/s prefill, 135 tok/s decode at 96K, reproducible across our A/B legs; your interleave harness passes on the legs where it applies), which is why the multi-user gap is worth writing up.
@SuperDistance commented on GitHub (Oct 13, 2026):
@superniker thanks for opening this to track it, it's very useful.
After #2050 I started on a different approach, close to your second ask: a real read thread. With
STRATA_PIPED_CONCURRENT=1the prompt is read on its own thread while the slots keep decoding, so there are no piecesand no drain, and the chunk size no longer sets the pause. It's up as #2326, and I think it fixes the biggest part of
this.
So far it looks promising. On 2x RTX 5090 the longest pause of a decoding stream went from 11.9 s to 0.8 s, and the
same work finished 6.4% sooner, at the cost of a later first token for the joining prompt (20-47%). It has also served
about a day of coding-agent traffic on my server with no stall or hang.
I agree #2050's gain depends a lot on the hardware. Your own numbers show why: each piece pays about 7.5 s of pipeline
fill, whatever its size. #2326 removes the boundary instead. It doesn't cover your first and third asks (drafts in the
batch window, one read at a time).
If you can run it on your rig, any data points would be much appreciated.
@superniker commented on GitHub (Oct 15, 2026):
Two corrections, and the pass/fail numbers we should have given in the opening
Correction to the rig line: our cards are 22 GB, not 11 GB (modded 2080 Ti;
nvidia-smireports 22,528 MiB). Everything else in the post stands. It is also why the expert caches are 9,400 + 6,790 slots and why our prompt chunk is 26,624 tokens — the cards are not as small as that line suggests.What "long-context multi-user" means for us as a number, so a change can be judged instead of taken on our word:
One update since the opening post: the streaming work does not move those numbers. We measured PR #2326 on this rig (report in that thread): with one stream decoding the mode is close to free — a 52 s freeze becomes a 3 s gap at +5% wall clock, and a one-line question is answered 44% sooner — but with three streams the same run costs 73% more wall clock, and the 4 x 96K case above is unchanged. So asks 2 and 3 (drafts that work inside the pipelined groups; a read that takes more than one sequence per pass, or gives way for a bounded cost) are still the only levers we have found.
If it is more useful than waiting on you: we can prototype ask 3 in our own tree and post the numbers plus the patch for you to accept, rewrite or reject. The shape looks mechanically reachable —
qsa_prompt_attn_batch()already takes per-row ids/steps (kernels/qsa_prompt_attn.hpp:27, called fromprefill.cpp:2844), so two sequences read side by side with their ownSessionState, GDN state and contiguous position ranges keep the kernel's own math identical. We would gate it behind an env var, leave the default path byte-identical, and run it on this rig against the same four-stream measurement. Say which shape you would take, if any.@havok2-htwo commented on GitHub (Oct 18, 2026):
Data for the "gives way for a bounded cost" half of ask 3 (short requests behind a long read); it does not move the 4 x 96K target. 4x RTX 3090, Qwen3.8-Flash-Next UD-IQ4_XS, 4-stage split, 16 slots,
--prefill 512, greedy. Unless marked 0.1.45: our fork on 0.1.44.1, 2 runs per arm, our own read beside the decoding slots (the shape of #2326) on in every arm except the one marked off.Giving way. Our read beside the slots did not take
BYIELD, so a short request waited out the whole read. OurSTRATA_READ_YIELDpauses that read at a chunk boundary while a request with at most 2048 new tokens waits and 8192 or more remain to be read, at most 4 times per request, and lets all waiting short requests through. Counting new tokens (the prompt less what a slot holds) is #1288's idea; ours uses fixed limits (2048 new, 8192 left), allows 4 and lets a burst through. 0.1.45's PIECE and CONCURRENT use the #656 rule (under half the length, at most 2 times). A give-way here waits one 512-token chunk; that cost does not carry over to a 26,624-token chunk.Stock 0.1.45 (
477ac13c), unset ->STRATA_PIPED_READ_PIECE=16384, same rig,piped_read_join_bench.py, 3 interleaved rounds. Not comparable to the two scenarios above (followup has no decoding streams and one 45K read). followup (short prompt 1 s after the cold read): short TTFT 11.7 -> 4.6 s, the read 11.4 -> 13.4 s. Joiners paid: cold32k joiner 8.2 -> 10.8 s, two_joiners 64K joiner 16.7 -> 38.3 s. Replies under PIECE differ (borrowed experts run on the CPU): 16x3 38/48 identical to unset; our agent mix 206 -> 276 s wall, TTFT p50 main 6.5 -> 9.1 s, sub 1.9 -> 9.7 s, with different output (5,577 vs 8,041 tokens).STRATA_PIPED_CONCURRENT=1turned itself off on this rig (in-place GGUF expert source; details in #2326), so there is no CONCURRENT number here.What did not work: two prompt reads at once in the background (not your batched pass). No gain in the 16-short burst (17.0 vs 17.1 s). In a 16-user x 3-turn bench (16x3) one 11K read waited 80 s, because a held read could wait 4 x (number of reads) picks; follow-up TTFT p50 rose 11.4 -> 13.1 s, 47/48 replies identical (the starved request then took another path in our fork), and our agent bench went 117 -> 142-148 s. A fix that bounds the wait is written, not measured. A design that holds a read needs a hard limit on its wait.
Admission by new tokens (#2109 changes the same pick).
STRATA_ADMIT_SHORT_FIRST=8192(mine, in 0.1.45) puts prompts of at most 8192 total tokens first, so it misses follow-ups with long histories.STRATA_ADMIT_BY_NEWapplies 8192 to the estimated new tokens instead (from block hashes of recent prompts and replies). 16x3 bench, give-way on in both arms but never taken here (follow-ups ~4.15K new of 15-20K, above 2048): follow-up TTFT p50 11.6 -> 3.1 s; cold first turns paid, p50 18.7 -> 26.4 s, p95 36 -> 59 s; 162.9 -> 157.3 tok/s; replies 48/48 identical. That wait came from our own read: with it off (#87, 1 run, older server), 1.9 s. Stock 0.1.45 with 16 slots has no such wait: follow-up p50 3.0 s (1 run), and 2.3 and 2.4 s with the merged batch switches andADMIT_SHORT_FIRST=8192(2 runs; turn-1 p50 20.2 s; 8 slots: 13.9 s, new order not tested there). Our fork with the give-way andADMIT_BY_NEW, same window: 2.5 s against stock's 2.4 s (3.1 s a day earlier; outputs differ, 13,984 vs 13,563 tokens). So I am not proposingADMIT_BY_NEW.Raw data: TESTLOG #87-#90 in https://github.com/havok2-htwo/StrataQ38FN
Not tested: our give-way and admission order on 0.1.45, HIP/SYCL/Metal, sampled output, 2-stage splits, other models.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@superniker commented on GitHub (Oct 20, 2026):
/reopen
Retest on 0.2.0-beta (engine 0.1.45.3): both gaps unchanged, and the concurrent read does not engage in any shape we can run
Engine: released
strata-engine-0.1.45.3-linux-x86_64-cuda-cuda13(strata 0.1.45, 65sm_75cubins) withserve/server.pyfrom the v0.1.45 source; no engine build. Driver 595.99.02.Rig: 2 × RTX 2080 Ti 22 GB (SM75), layer split 24 / 24, IQ3_XXS native pack + PLE, 262144 ctx, int8 KV,
--kv-resident 65536,--spec 4 --spec-min-p 0.5,--batch 4,--batch-groups auto(engine log: "2 groups of 2 slots", "strata batch (pipelined, 2 groups of 2)"). 123 GB RAM.Four 78,653-token prompts, cold, 256 tokens each
STRATA_PIPED_CONCURRENT=1--remote-expert-opt--remote-expert-opt,STRATA_PIPED_CONCURRENT=1--prefill auto:8192(the new default picked 18,432)All five arms are within 0.5% of each other: 0.2.0-beta reproduces 0.1.43 exactly on this workload, and none of the knobs moves it.
One decoder at 2K context beside a peer's 78.6K read (the case #2326 targets)
CONCURRENT=1--remote-expert-optCONCURRENT=1The decoder stops for the whole read (one 78.6K prompt is about 50 s here) in all four arms.
Why we could not produce a CONCURRENT number that means anything
concurrent_read_off()(include/strata/program/batch_read.hpp:44-52) refuses besideSTRATA_PREFILL_HELP,STRATA_SPLIT_MTP_BATCH,STRATA_FS_SLOTS,--pcie-mode dma, the helper caches, an expert source that stages its blobs, and this expert source. Our production line carries--remote-expert-opt, i.e. a helper cache; with it removed, the expert source is the native pack +--nativeGGUF. Either way the numbers are identical, which is what the refusal list predicts.The question we need answered to be able to test #2326 at all: which expert-source shape on our hardware lets the read thread engage (plain
--packwithout--native? experts resident in host RAM? a cache device)? We will run it the day we know.Two smaller things:
--pipeline-windows 2is switched off by--batchslots on this build ("--pipeline-windows 2 is off: not with --batch slots"), so what our server runs is "2 groups of 2 slots", not the pipelined windows #2326 describes.STRATA_READ_YIELD(havok2-htwo's fork) is not in 0.1.45.3, so the give-way half cannot be retested on 0.2.0-beta.Correction to the opening post
The four first-token values in the original report, 51.1 / 102.9 / 154.6 / 206.4 s, sum to 515 s, not 412 s — an arithmetic slip on our side. The 0.2.0-beta values 50.2 / 101.2 / 152.2 / 203.2 sum to 507 s, the same within noise.
The ask is unchanged
@github-actions[bot] commented on GitHub (Oct 20, 2026):
Reopened, thank you. A maintainer will pick it up from here.
@yusheng227507 commented on GitHub (Oct 21, 2026):
Reproduced on 2x RTX 2080 Ti, engine 0.1.46.3: 3.3x for the last of four 130K prompts, and a decoding slot waits 188 s behind a peer's read
Same shape as the report, on the same card class, with the current engine.
Setup: 2x RTX 2080 Ti 22 GB (sm_75), NVLink NV2, PCIe 3.0 x8 host link (6.5 GB/s), driver 595.99.02, Strata
9de04cd4(v0.2.1.4), engine 0.1.46.3 built from source for sm_75, i7-10700K (AVX2, no AVX-512), 94.1 GiB. Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, 262144 context, kv int8,--kv-resident 32768,--spec 4 --spec-min-p 0.5,--layer-split 26, 3 slots, MTP on,STRATA_SM75_PERF=1,STRATA_EXP_MODE=8, and--prompt-cache 0so every prompt is really read.The document is 130,272 prompt tokens (the same repeated paragraph), asked for one number.
One prompt alone: 74.2 s from dispatch to the answer (the read at ~1750 tok/s).
Four of them at once: the four answers came back at
The last one is 3.3x the first (your report: 4.04x for four 78.6K prompts), and the four reads are strictly serial - each one starts after the previous finished.
A decoding slot behind a peer's read: with one request generating 2000 tokens and a second request reading the 130K document at the same time, the generating request's first token arrived at 187.8 s - it waited for the peer's read to finish - and then generated its remaining ~1900 tokens in 9.8 s. So the slot is not slowed down, it is blocked until the peer's read is done, which is the same effect your report describes ("a peer's prompt read leaves a decoding slot at 3.67 tok/s").
Two notes that may help:
--prompt-cache 0is what makes this visible: with the conversation cache on, a repeated document is resumed from the cache and the read disappears. The cache makes the symptom intermittent in practice, which may be part of why it looks like a routing or slot problem.Nothing here is a regression: 0.1.45.3 and 0.1.46.3 behave the same in this shape on this box. It looks like the architecture gap the issue describes rather than a bug in one version.
@oscarlius commented on GitHub (Oct 22, 2026):
Additional observation: 55.314 s before prompt reading on four RTX 4090s
Observed on 2026-10-22 in natural multi-user traffic: a request with 112,522 reused tokens waited 55.314 s before its native prompt command was submitted. This supports the serialized-admission concern in this issue; it is separate from the cache-copy cost discussed in #3321.
Environment: Linux, four RTX 4090 24 GB, Qwen3.8-Flash-Next IQ3_S, source-built engine 0.1.46.3, upstream base
9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4(v0.2.1.4). The deployed Python server also has local monitoring/accounting fixes; this is not an unmodified-release benchmark. Relevant settings: 16 slots, 4 pipeline groups, prefill chunk 2048, context 262144, int8 K/V with resident 24576, conversation cache 98304 MiB / 1024 entries.STRATA_ADMIT_SHORT_FIRSTwas unset. Client maximum output remains 32768; gateway route timers remain 600 s.Observed event sequence
The following uses anonymized request labels and seconds relative to request A being queued. All events are from the same Strata telemetry stream, not correlations between gateway and engine timestamps.
A: prompt 136696 = 112522 reused + 24174 newly read. Its reading-to-first-token interval was 11.494 s, consistent with native
prompt_ms=11449.2. A completed normally. C had 191328 prompt tokens, no reuse, and reported native prompt time 53.6171 s; C eventually disconnected, so its partial decode counters are not used here.The pre-reading interval splits into about 45.931 s until C's first token, 1.384 s before B starts reading, 7.052 s for B's reading-to-first-token, and 0.946 s before A starts reading. Rounded components total 55.313 s; the directly measured interval is 55.314 s. The two handover gaps are not further attributed. B arrived about 38.5 s after A but acquired the reading path first.
Code path and interpretation
admitteddoes not mean the native control lock has been acquired. Thereadingcallback runs after sending GEN/BGEN._take_controlserializes admission on onectllock. With short-first admission disabled, lock acquisition has no FIFO guarantee; the event sequence demonstrates overtaking in this workload._shorter_waitingcompares total prompt lengths, not the uncached remainder. A's 136696-token total does not satisfy the half-length condition against C's 191328-token prompt, despite A having only 24174 new tokens.pick_slotdeliberately ignores held-token affinity because pad rows can overwrite idle slots. Python's slot history alone is therefore not a reliable native-cache cost estimator.The inspected admission/yield logic remains equivalent in commit
011c9e6(0.2.2). This is evidence of serialized prompt admission and a cache-unaware length heuristic, not proof of a deadlock, a hard 55-second timer, or a new-version regression. Sixteen slots do not provide sixteen independent prompt readers.Limits and current status: this is an observed production trace plus code inspection, not a controlled cache-aware scheduler A/B. Private prompts are withheld, so it is not a byte-reproducible benchmark. No claimed speedup, no new stress run, no restart, and no candidate deployment. Repair work and PR submission are deferred to preserve service continuity; this comment only adds the localization evidence to the existing discussion.
@oscarlius commented on GitHub (Oct 22, 2026):
Controlled 16-request follow-up: cold-input TTFT reaches 331.08 s; cache hits still queue
Following our earlier localization comment, we ran a bounded test on 2026-10-22: 66/66 requests completed with correct six-key retrieval answers, no timeout, no premature SSE EOF and no client-disconnect increase. This confirms completion for this workload, not low-latency or long-term multi-user acceptance.
Environment: Linux, four RTX 4090 24 GB, Qwen3.8-Flash-Next IQ3_S, source-built engine 0.1.46.3 / upstream base
9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4(v0.2.1.4), with the previously disclosed local Python monitoring/accounting patches. Settings stayed at 16 slots / 4 pipeline groups, context 262144, prefill chunk 2048, int8 K/V / resident 24576, conversation cache 98304 MiB / 1024 entries. Every request sent output cap 32768; gateway route timers remained 600 s. No model restart or candidate deployment.Workload and results
Each of 16 synthetic histories had about 130.7K rendered input tokens, a distinct early system prefix and distinct six-key answers. Identical payloads were replayed for cache-hit rounds. Thinking was disabled; output stopped naturally at about 230 native tokens. TTFT measures the first non-empty model content delta, excluding role, metadata and heartbeat chunks. There were no retries.
The first wave is deliberately labeled mixed: one history had already been warmed by the single-request probes. Among its 15 zero-reuse requests alone, TTFT median was 176.28 s, max 331.08 s. Each of the following three 16-way waves was verified near-full-hit using native cache counters, with no more than 64 newly read tokens.
Evidence of waiting before prompt reading
Terminal sampling limit: the telemetry endpoint exposes only its trailing 32 events. In hit replay 2, one
queuedevent fell out between polls, so its phase statistics use 15 observed terminal pairs, while all 16 client TTFT/completion records are intact. The 31.84 s value is the observed phase maximum, not a claim of complete terminal-event coverage.The single-hit result and the 16-way hit replays make the distinction clear: cache reuse is working; admitted requests still wait before they can use the reading path. The copy cost discussed in #3321 is additional work on that shared path, not an explanation for all 331 seconds.
Safety and limits
The native completed-request counter increased by exactly 66; the client-disconnect counter stayed unchanged. No other inference requests mixed into the measured window, no new cache evictions, no OOM or swap, minimum observed host available memory about 36.24 GiB and peak GPU temperature 72 C. A guard was set to stop test-owned sockets on resource limits or incoming business traffic; it did not fire.
This is a finite roughly-128K-input / short-retrieval-output test. We did not test 16 x 256K input, sustained 32768-token output, tool-agent endurance or desktop SDK/UI behavior. The HTTPS replay covers the hit case; the cold concurrent wave was direct to Strata, not repeated through the gateway. Gateway-reported usage uses a different token count; input size and hit classification above use native counters and offline rendering. No benchmark fixture, business text, private address, credential or unvalidated patch is attached. Repair work and PR submission remain deferred.
@Adamyno commented on GitHub (Oct 22, 2026):
The target profile, from the production side (3× RTX 2080 Ti 22 GB, sm_75, layer split)
Our box serves a small team — two to three concurrent users — and the config we're converging on is the one superniker's asks point at: 2 slots on a 2-card split, the third card kept for the auxiliary tasks (embeddings, vision). From our measurements the split itself is not the limitation: 2 → 3 cards scaled single-stream decode by +64 % (our #2939 comment), so the two gaps in this issue are what decide whether the 2-slot config stays usable as sessions grow.
Where we stand today: our agent sessions are in the 1.6–12.6K prompt range, and the 60-minute
--batch 2soak we published in #2650 (505 requests, no drift) stayed healthy — at that prompt scale a peer's read costs seconds, not the 70–400 s that superniker's 78.6K and yusheng227507's 130K sessions measure. But agent sessions grow monotonically, so those depths are exactly where our users land.One confirmation from our side of oscarlius's admission finding: with the conversation cache on, total prompt length is the wrong comparison key once reuse dominates — the uncached remainder is what should gate short-first admission (a 24K-new-token request losing short-first admission against a 191K-total request is that case in the wild).
Reproduction status: no new measurements in this comment; the soak is ours in #2650, the 2→3-card scaling in #2939.
@Adamyno commented on GitHub (Oct 22, 2026):
Cache-aware
_shorter_waiting: the give-way check compares the uncached remainder, not the total prompt lengthBuilding on the localization in the two comments above (and superniker's reproduction): the
give_way/askBYIELD check uses the reading request's total prompt length, but the cost that matters at that point is the uncached remainder (what the engine still has to read after the cache hit). A warm request with a large cached prefix and a small remainder should not give way to a shorter cold one — and a cold one with a large remainder should.The fix (one function + its two call sites,
serve/server.pyon011c9e6):What changes:
give_way()andask()now passremaining = len(prompt) - (self.reused or 0)instead oflen(prompt). Whenself.reusedis 0 (no cache hit, the common cold-read case),remaining == len(prompt)and the behaviour is exactly as before. When the engine reports a largereusedcount, the reading request's cost drops to the remainder, so the BYIELD no longer fires for it.Reproduction status: the patch is untested on hardware (no multi-user load on this box at the moment). The scenario it fixes is the one in the trace and the controlled test above: a request with 112,522 reused + 24,174 new should not give way to a shorter cold request, and the
_shorter_waitingcheck withremaining = 24,174correctly returns False for a waiting request at 70K. Without the fix, the same check withplen = 136,696returns True (70K × 2 ≤ 136K), and the warm request's read is paused for a shorter cold one that costs more wall time.Limits:
_admit_next(theSTRATA_ADMIT_SHORT_FIRSTordering) still uses total prompt length at admission time — the slot's cache state is not known beforepick_slot. Fixing that would need the admission to happen after the slot is picked (or a cache-state estimate passed in). Thepick_slotheld-token affinity gap (pad rows overwriting idle slots) is also not addressed here.@oscarlius commented on GitHub (Oct 25, 2026):
Further localization on v0.2.5: retained long contexts and remaining-work hints (partial experiment)
This is a follow-up to our earlier 55 s admission and 16-client measurements. It is not a claim that #2275 is solved, and is separate from the native copy changes in #4002.
Environment: Linux, four RTX 4090 24 GB, Qwen3.8-Flash-Next IQ3_S, native engine 0.1.50. The executable is unchanged from our disclosed v0.2.5 candidate (
f37e34b8de19218b1077e155802ac87dd63ef0c1498ca5052b362778fcc29f45). That candidate includes #4002 plus previously disclosed serving changes, so this is not a stock-release result. The experimental Python server is SHA-2560a40359f4999ee1c20e0643bfebb6e52154fd5601f558456b8fab27644034dab(patch not yet submitted). Four stages, 16 slots, context 262144, int8 K/V with resident 24576, cache 98304 MiB / 1024 entries and 32768 MiB minimum-free protection, server output default 32768 and engine-silence budget 600 s were preserved. These synthetic requests explicitly cap output at 256, disable thinking, and check six-key retrieval JSON plus complete SSE termination. GPU limits were 220 W during this experiment as a temporary thermal-protection profile; this is not a power recommendation or a comparison with earlier power profiles.Observed mechanisms
pick_slotcannot safely use the usual idle-slot cache affinity. Explicit 16 groups gives one slot per group, allowing that existing affinity path. This changes scheduling/retention and can have throughput costs; it does not add independent native prompt readers.Complete portions of the 16-group exploratory run
Each long history is distinct, approximately 130.8K rendered tokens; the repeat uses byte-identical request payloads.
Before the repeat, all 16 idle slots reported approximately 131K held tokens. The native trace for the repeat contained no fresh prompt READ lines, while the cold preparation had 16. Both waves produced 3716 completion tokens. This supports retained-context reuse; the 27.484 s last TTFT also shows that admission/restoration still queues.
A separate complete 3-cold + 1-warm diagnostic produced all four correct answers: the warm request's TTFT was 1.224 s with cache_n=130811; cold TTFTs were 19.527 / 37.835 / 56.107 s. One cold request reported cache_n=12288 after its own BYIELD. We retained that raw value: the same-wave trace uniquely shows a read from zero to 12288/130820, then a yield, then the remaining read. It is self-resume, not evidence that its input was pre-warmed. This classification was declared before this run and requires that native evidence.
A measured tradeoff, not a universal setting
One exploratory same-payload short-input 16-client comparison used the same server/native files, remaining-work hint enabled in both arms, and 220 W in both arms; group count was the runtime-configuration difference. The preceding workload order was not normalized, as detailed in the follow-up below. Both arms completed 16/16, produced 3300 output tokens, and had identical per-request input and output hashes.
Thus this one short-control pair shows about 12.2% lower whole-wave output throughput with 16 groups. This is end-to-end client throughput, not a decode-kernel benchmark. It is only one pair; the group-retention comparison and repeated full protocol are still incomplete.
Other cold16/mixed runs were deliberately aborted when unrelated real requests arrived; only the test's own connections were cancelled. Those runs remain incomplete and are not filtered into a success rate. There is no completed three-round acceptance, no sustained-load power acceptance, no failure-injection claim and no claim that all-cold long-context queueing is fixed. The short controlled output cap also does not establish 32768-token output soak stability.
Follow-up: first four-group cache-repeat result; preparation-order limitation
The four-group arm has now also completed the same 16-history cold preparation and identical replay: all 16 replay requests hit approximately 130.8K tokens, all responses were correct/complete, all per-request replay input/output hashes match the sixteen-group arm, and its replay native trace also has zero fresh READ lines. Four-group replay TTFT was 6.568 s median / 12.078 s maximum (3716 output tokens, 18.831 s whole-wave wall time), versus 14.316 / 27.484 s (40.469 s wall time) for sixteen groups. This is counterevidence to treating sixteen groups as the remedy, and it will not be promoted on the current data.
There is a protocol deviation in this first exploratory pair: the four-group short control ran before its long protocol, while the sixteen-group short control ran after its interrupted long protocol. Preceding workload/graph/cache preparation was therefore not normalized. The identical payload/output hashes and measured timings remain valid observations, but neither throughput difference nor the long-repeat latency difference is a completed causal group-count A/B. All old data are retained; no failed or interrupted run is relabelled as passed. A same-order, counterbalanced comparison is required for a causal speedup claim.
Follow-up: native-READ-gated remaining-work comparison (one complete pair)
We corrected an earlier timing-method limitation: a fixed two-second delay can send the hot request before cold native prefill starts. In this protocol, the hot request is sent only after observing a current-wave native slot actively reading an approximately 130.8K-token prompt, with at least 8192 tokens read and at least 32768 left. A fresh reading-state check immediately before POST is retained. TTFT starts at the actual hot POST; waiting to simulate the late arrival is not included.
Both arms use four groups / 16 slots, the same frozen request bodies, the same server source
0a40359f4999ee1c20e0643bfebb6e52154fd5601f558456b8fab27644034daband native executablef37e34b8de19218b1077e155802ac87dd63ef0c1498ca5052b362778fcc29f45, fresh native starts, and the same 220 W/fan profile. The experimentalSTRATA_YIELD_REMAININGflag is the OFF/ON difference. Short-first threshold 8192 and age override 30 s are unchanged. The native executable already contains #4002: this does not isolate that PR's effect.Every measured phase passed its strict six-key bare-JSON check, full SSE termination, and cache-evidence gates. All per-request input and output hashes match across arms. Each arm completed 68 measured requests plus three single-request preparations (71/71). The two gated warm requests actually reused the same 130809 / 130813 tokens in both arms. Native process identity and executable/source hashes remained stable within each arm.
For the gated 15-cold case, OFF posted while slot 4 had read 8192/130820 tokens; ON posted at 10240/130826. For the independent diagnostic, OFF posted at 14336/130821 and ON at 12288/130818. The ON traces prove one existing cold read yielded at 20480 / 22528 tokens, respectively, and resumed; its raw nonzero cache count is retained and classified as same-request resume with a unique native READ-from-zero/YIELD trace, not a pre-warmed cold request. The hot first token preceded that yielded cold request's first token. OFF showed no corresponding yield. The simultaneous mixed wave is not used as preemption proof.
This is one completed pair, not three counterbalanced rounds or production acceptance. Actual order was an initial OFF attempt aborted for unrelated traffic, then complete ON, then the single predeclared external-interference-only OFF retry; the original attempt is retained. An earlier R19 attempt also retains its strict fenced-JSON failure, and its fixed-delay timings are not used to prove preemption. No parser relaxation, discarded failure or silent retry was used.
The result supports a specific mechanism: cached long histories were being compared by total length when deciding to yield, so a nearly all-cached arrival could remain behind cold work. Remaining-work hints can make the existing yield path useful without treating matching token IDs as matching KV bytes. It does not remove serial cold-prefill capacity: cold16 remained about 164 s median. Nor does it prove all partial-cache tails work: a subsequent local patch for a 112522-cached + 24174-new-token selection case has CPU tests only and is not the source tested here. It is not deployed or submitted, and is not part of #4002.
Thermal observations are limited to this profile and workload: ON ran 1081 s (429 samples), OFF 1090 s (432 samples); per-card peak temperatures were 75/73/70/76 C and 75/72/71/77 C. Both had zero query-error samples, zero new thermal/power-brake counter increments and no active thermal/hardware-brake samples. Instantaneous power readings sometimes exceeded the configured 220 W cap and are retained; these are not constant-four-card-full-load tests, a validation of 300/320 W, or a matched 450 W performance comparison. GPU 0/3 fan targets were 100%, GPU 1/2 automatic.
The frozen short-input 16-client control ran last after the full long protocol in both arms, with unchanged within-arm native identity and cache_n=0 for all requests. Both produced 3300 completion tokens with identical per-request input/output hashes: OFF 13.838 s whole-wave wall time / 238.47 client output token/s, ON 13.302 s / 248.09 token/s. Each arm therefore completed 87/87 correct requests including preparations and the short control. This is one end-to-end control pair, not a decode-kernel speed claim or a randomized repeated result.
V3 partial-cache checkpoint probe: one hot response observed, paired run incomplete
A subsequent local serving patch (
4653161b, server SHA-25601a75147a93e6ea8ba010bc1b58bf9aaf0a3996ec41c15d9989796c390316c26) ranks only fresh priority-1 admissions by estimated remaining work; default-off and the short/age FIFO protection remain. It is separate from #4002 and has not been submitted or promoted. The native executable remains the same disclosed 0.1.50/f37 build.We constructed a new user turn using the real pack tokenizer, actual server renderer and token-ID turn-checkpoint rule, not character lengths. Measured warm length was 112529, full length 136696, maximal token LCP 112523, and stored warm turn-prefix 112522. The actual scheduler prefix-hint helper also returned 112522. Maximal LCP and reusable native checkpoint are different quantities; requiring them to be equal would reject this valid turn boundary.
In the ON probe, the hot request was posted after observing a current-wave cold slot reading 14336/130070 tokens, rechecked immediately before POST. Its actual response reported cache_n=112522, hence 24174 newly processed tokens, with 4.961489 s TTFT, correct six-key bare JSON and complete SSE. This tail is larger than the 8192 short cutoff. The trace includes a cold read giving way at24576. This is a synthetic repeated-padding functional probe, not a realistic-text throughput or financial-understanding benchmark.
The hot response finished before an unrelated additional client request arrived. The guard then cancelled only our remaining two cold connections: 3/5 test requests including preparation completed correctly; the overall ON wave is incomplete. The planned fresh OFF counterpart subsequently could not establish an idle baseline while a real client was generating; zero OFF test inference requests were sent. Its initial-idle timeout is not an observed Strata inference timeout.
Both attempts and raw counts are retained. No extra client was blocked or terminated, no failed attempt was reclassified as passed, and the original business service was recovered with its configuration/authentication preserved. We are waiting for an uncontended test window before further pressure. There is no paired V3 speedup, no three-round acceptance, no proof that all-cold queueing is solved, and no new merge-readiness claim from this observation. The older R22 comparison remains V2 evidence and is not counted as V3 testing.
[GH-ISSUE #2275] [Engine] [Direction] Aim Strata at long-context multi-user: a peer's prompt read leaves a decoding slot at 3.67 tok/s, the batch window emits 1 token/slot, and 4 streams take 4.04x a single read to their first tokens (2x2080 Ti layer s…to [GH-ISSUE #2275] [Engine] [Direction] Aim Strata at long-context multi-user: a peer's prompt read leaves a decoding slot at 3.67 tok/s, the batch window emits 1 token/slot, and 4 streams take 4.04x a single read to their first tokens (2x2080 Ti layer s…@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.