mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#640
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 @ylzbj1-stack on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1603
parallel: 2+ two long-context sessions: the request hangs withrunning: 0 / queued: 0and the #1317 frozen-engine watchdog never sees itEngine: 0.1.41 (
strata-windows-x64.zip,BUILD.json→version: 0.1.41,cuda 13.0,archs [75,86,89,120])Server:
serve/server.pyfrom the same tagOS: Windows 11, WDDM
Related issues
Here the request turn is not held:
/metricsreportsrunning: 0,queued: 0,waiting: 0while the client is still waiting. So #1317's frozen-engine check (
ENGINE_STALL_S, 90 s) hasnothing to watch and never fires — I grepped the whole engine log and the server stdout for
has said nothing for/frozen/EngineSilentand there is no such line, ever.serve engine deadlocks in SleepConditionVariableSRW during a long streaming reply.Same "lost step" family, but mine is reproducible by two concurrent long sessions.
a >100k-token prompt deadlocks the pipelined verify-window reader (--pipeline-windows >= 1). Not this one: I do not pass--pipeline-windows, and my promptsare ≈40 K, not >100 K.
Environment
layer_split: auto→ CUDA0 layers 0–24, CUDA1 layers 25–47parallel: 2,--max-context 262144,--kv-resident 32768,--kv int8,--spec 4,--prefill auto,--expert-cache auto,--vram-reserve-mib 700,--vision--pipeline-windows, no--batch-groups, no--resident-expertsReproduction
Two long-context conversations (~40 K tokens each) active simultaneously on
parallel: 2,with at least one of them needing a chunked, partly-cold prefill. A later request (long or short)
then hangs in the client forever.
It is not deterministic — it needs the two long prompts to be in flight close together. Once it
happens it stays until the client cancels.
Symptom — both states captured via
GET /metricsHung:
Healthy, seconds later, after closing the second long session:
So the request is neither
running, norqueued, norwaiting, and there is no TCP connectionheld by it — yet the client is still on the "waiting for token generation" panel. Whatever booked it
in was released without ending the client's turn.
Evidence
1. Both long requests admitted in the same second
/metrics → requests(server-side bookkeeping; every entry here endsfinish: "stop"):The server believes it completed everything. The client-side turn never ended.
2. BYIELD fires repeatedly — the two slots keep interrupting each other's reads
3. Control experiment
expert-cache hit 95–98 %, KV streaming 99.7 % of block reads hitting VRAM, drafts ≈ 72–80 %.
4. The transport is not the problem
A streaming request to the same server completes:
chunks=77,finish_reason=stop,data: [DONE]received (server.py:4985), 3.5 s.5. Nothing in the log about the hang
Neither the engine log nor the server's stdout has any line for the stalled request — no
engine_silence_s/STRATA_ENGINE_STALL_Snotice, no engine restart, no error. The request simplynever appears.
Where I would look
The admission path in
server.pyaround thed9621d1comment (0.1.41):d9621d1handles "waiting for a slot". Mine is the case where a yielded read (theif self._yielded is not None:branch just below, and theBYIELDsends at_send(f"BYIELD {slot}"))and a waiting admission contend for the same control lines while a third request is also waiting.
The end state (
running: 0andqueued: 0andwaiting: 0with the client still waiting)suggests the request is dropped from the bookkeeping rather than merely blocked — which is also why
ENGINE_STALL_Scannot catch it: the frozen-engine check only runs while a request is outstanding.What I can provide
/metricssnapshots in both states (hung and healthy)STRATA_DBG_FEAT,ROUTE_OVERRIDE, or any env flags you wantWorkaround (for other users hitting this)
Do not run two long-context sessions concurrently on
parallel: 2. Short requests are safe to runconcurrently — they do not trigger a BYIELD yield. A single long session is stable at 100+ tok/s.
@ylzbj1-stack commented on GitHub (Oct 10, 2026):
Follow-up (2026-10-10): what the engine reports while it is slow — VRAM expert-cache hit rate down to 55.9%, KV streaming down to 0.00%, and
drafts accepted 0 of 0in every DONESame rig as the original report (Windows 11 / WDDM, 2x RTX 3080 20 GB layer split, Xeon E5-2696 v3 18C/36T — no AVX-512, 128 GB RAM, Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS + MTP, engine 0.1.41 from the release zip,
strata.exe164,440,576 B). One config change since the report:--batch-groups 1was added (autoresolves to "2 groups of 1 slot" on this layer split, i.e. the pipelined path — that warning in #1413 is not printed in this session, so this one runsbatch_step).Only two conversations are involved: slot 0 at ~136-137K tokens and slot 1 at ~131-132K tokens, alternating turns. Nothing else is running.
1. The decode expert cache hit rate falls to 55.9% (lowest of 833 such lines in this log)
The same numbers appear in
/metrics(requests[0].hit_rate = 0.559,pcie_share = 0.008) and in the panel row (VRAM HIT RATE 55.9% +0.8% PCIe), so it is the engine's own accounting, not a UI artifact.480 routed = one decode window (48 layers x 10 experts); the 210 lookups that did not hit went to the CPU pool, not the disk (
ram_blobs 0,file_blobs 0). The batch summary printed for the same window says the same thing for the whole run, so it is not a single cold window:CPU experts 4.96vsVRAM hits 4.86per layer-window = ~50% of the decode's experts computed on the CPU for that whole stretch.2. It gets worse within one session, and every low value sits next to a slot give-back/take of a ~136K conversation
(row 5 is the same session summary as the 206-window run above; the last two rows are the ones preceded by)
The previous session on the same 0.1.41 binary with
--batch-groups autoand ~100-115K conversations ran 21-35 ms/window, 93-99% expert hit rate and 98.8-99.0% KV hit rate, with1191 generated in 11390 ms (104.6 tok/s), drafts accepted 819 of 1073. So this is not "0.1.41 is slower"; it is what a 136K x 2 + slot rotation does to both tiers here.3. Cache sizing at startup on this run (the placement plan does not fit what
--batch 2leaves)8536 + 6472 = 15008 resident experts against the 17231 pairs the placement picked, and the prompt path then borrows from the same cache:
Question: should
--batch 2's slot sessions (0.89 GiB on CUDA0) be charged to the placement before the 46 placements are scored, instead of shrinking the cache afterwards and keeping a ~99% prediction?4.
drafts accepted 0 of 0in every DONE of this session (10/10), including the 1000-token onesIn the previous (
--batch-groups auto= pipelined) session the same requests showedsuffix drafts: 21 windows, 105 of 105 drafts acceptedanddrafts accepted 586 of 731. In this session nosuffix drafts:line is printed at all anddrafts_offeredis 0 for all four requests in/metrics.--batch-groups 1keepspiped = false(generate.cpp:8503), so #1413's mechanism should not apply and its 0.1.41 warning is indeed not printed — but the drafter still produces nothing. Is the per-slot MTP drafter gated on something thatbatch_step+batch 2does not satisfy?5. Small reporting bug found on the way (server side, not engine)
In batch mode the console prints the same engine position for two different requests, with each request's own elapsed time, which reads like a duplicated task:
_progress()(serve/server.py:3399) uses the one globalself.engine.progresstuple forX of Yand the per-requeststartedfor the elapsed, whileprompt_progress()(serve/server.py:3933) already returnsNoneunder--batchprecisely because "the engine's progress is one global line, not this request's". The log line just does not apply that rule — worth tagging the slot or suppressing it in batch mode.Related
136077 = 135502 reused + 575), so that failure mode is not what is seen on this box.--conversation-cache-mibis not set here at all (/metrics:conversation_cache_mib 0,enabled false).--batch-mtp), #1668 (missed experts;STRATA_ROUTE_TAIL_SKIP/STRATA_ROUTE_PRIORare not in 0.1.41 —STRATA_ROUTE_RESIDENTis), #1842 (0.1.41 128K decode vs 0.1.40.3; next A/B on this box isSTRATA_MMVQ_IL=0, sm_86), #1846 (--expert-cache autofree-VRAM reading on Windows/WDDM).@ylzbj1-stack commented on GitHub (Oct 10, 2026):
Follow-up (2026-10-10): with
--batch-groups auto(piped) a long prompt read is not split into parts, and the other pipeline group's decode freezes —--batch-groups 1splits it and keeps the decoder at 5-13 tok/sDifferent signature from the original report, same rig and same two long conversations: here
running: 2(no hang, no queue) but one slot makes no progress for minutes. Config A/B, only--batch-groupsdiffers between the two launches.0. Rig and the two launches
Windows 11 / WDDM, 2x RTX 3080 20 GB, layer split
auto, Xeon E5-2696 v3 (18C/36T, no AVX-512), 128 GB RAM, Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS + MTP, engine 0.1.41 from the release zip,"parallel": 2,--expert-cache auto --prefill auto --spec 4 --mtp <rt> --max-context 262144 --kv int8 --kv-resident 32768 --vision --vram-reserve-mib 700 --spec-min-p 0.5 --layer-split auto --batch 2. The two launch lines differ in exactly one argument:autopicks--batch-groups auto: 2 groups of 1 slot(sopiped = true),1turns it off. Side effects of the two placings, for completeness: expert cache 15008 slots (batch-groups 1) vs 14833 (auto), layer split 0-22/23-47 vs 0-24/25-47.1. Measured, settings
auto(piped): the read is one run, and the other group stops/metricssampled every ~20 s while one slot read a 160K prompt and the other was "decoding":4 tokens in 120 s (0.03-0.1 tok/s), and the token counter does not move at all across those 42 s — while PCIe carries 3.5-5.0 GB/s and the GPU sits at 46-80 %, i.e. the machine is busy with the other group's read. The engine's log for that read:
Note what is absent from that whole session:
strata batch: the prompt was read in N parts, the slots decoding X ms between them. (The cache side is fine here: 97.5 % expert hit rate,finish: stop, no disconnect.)2. Measured, settings
1(not piped): the same read is split and the decoder keeps movingSame two long conversations, same
--batch 2,parallel: 2. The read of a 130-160K prompt then costs 127-190 s (740-1200 tok/s, i.e. it pays for the interleaving), but the other slot kept decoding: measured over 20 s of/metricsdeltas,generated 1222 -> 1489= 13.4 tok/s (console showed 4.9-5.5 tok/s instantaneous, decode windows 30-93 ms).So the two settings trade the two goals off differently —
automakes a fresh 166K read 2-3x faster (2410 tok/s vs 740-1200) at the cost of starving the parallel decode to ~0, and1does the opposite. Neither is a "both" answer.3. Why:
read_part()skips the interleave wheneverpipedsrc/program/generate.cpp(0.1.41), inside the batched prompt read:With
pipedthe whole prompt goes throughsp.run(...)in one call, so thedecode_sharebudget, thebatch_step()loop andil_partsnever run:STRATA_BATCH_DECODE_SHARE(and any chunk-boundary yield to the slots) is inert under--batch-groups G > 1. That matches the log exactly — noread in N partsline, and the other group only gets whatever the stage overlap gives it.The comment says this is deliberate (the layer split is meant to overlap stages instead), and
docs/BATCHING.md:40documents the piped aggregate gain ("2 GPUs 109 against 78"), and:132says a pipelined slot is a conversation cache again and "a request left alone in its slot goes back to the solo path with its drafts" — which holds when the other slot is idle. What is not documented anywhere I could find is the per-request case below: two busy slots, one of them reading a 160K prompt, the other decoding at 0.03 tok/s for two minutes.4. Questions
pipedtoo? If not, is the intent that a long read may starve the other group until it finishes — and should--batch-groups autobe the default for a 2-slot setup where both slots hold 130-160K conversations?STRATA_BATCH_DECODE_SHARE: setting it under--batch-groups autochanges nothing here, because the block that reads it is skipped whenpiped. Worth saying in the docs, or moving the check?5. What I run now
"parallel": 1— with one request at a time the read is a single fast run (2410 tok/s) and nothing else competes, so the 0.03 tok/s case cannot happen. It does mean the client's second conversation waits.Related
running: 0): different signature, possibly the same two-slot contention. #1604 cross-references both.--batch-groups G>1+--batch-mtpinert on the piped path) — samepipedflag; note the piped path also reportsdrafts accepted 0 of 0on every admission in this session, while the non-piped session had working drafts andsuffix drafts:lines.STRATA_ROUTE_TAIL_SKIP/STRATA_ROUTE_PRIOR) — those two are not in 0.1.41,STRATA_ROUTE_RESIDENTis.--pipeline-windows 2/cudaSetDevicestall (60 s, then a restart), and #1763's fix is an unmerged PR touchingsycl/serve/server_intel.pyonly.@Niko1221 commented on GitHub (Oct 10, 2026):
Thanks, the metrics captures were the key. We could not reproduce your exact hang, so we hardened every state in the server where a parallel request could be invisible: (1) a busy slot flag with no owner (no request holds it, no BDONE wait is running) is now freed after 3 s, with a log line, so a request waiting for a slot cannot wait for one nothing will free; (2) a request waiting for a slot is counted (metrics: live.admitting) and, after the stall time (STRATA_ENGINE_STALL_S, 90 s), the log names what is busy and who owns it; (3) a parallel request on a loaded engine no longer takes the FIFO (which an image encode, /v1/vram or a load can hold), and a request that waits for it to start the engine now stays counted as queued instead of being neither running nor queued. There is a fake-engine serve test for each (before the change two of them hang). If it still happens on v0.1.42, the log line from (2) and /metrics at that moment will tell us which state it is in.
@ylzbj1-stack commented on GitHub (Oct 11, 2026):
Follow-up: a mid-decode hang that never recovered and blocked the whole server (parallel:1).
Engine 0.1.42, "parallel": 1, ~190K context, Windows. State at the time of the hang:
The request that hung
Read the request line twice, because the numbers disagree with themselves:
max_new=89225/max_tokens 89225max_tokens 89225budget 99187 (max 132249)-- a different number again.I am not sure which is a bug and which is just two different counters (the request's cap vs the slot's cap), but the three numbers on four consecutive lines (89225, 89225, 99187, 132249) are worth a look on their own.
What is wrong, independent of the trigger
Suggestion
Note
This is not the #1603 hang pattern I could reproduce before (that one was at admission). This one is mid-decode: three tool-call progress lines were printed, then silence. The last emitted token index was 188 of a 132249 cap, so truncation is not the cause either.
Restarting the engine cleared it (a fresh start at 16:47:40 loads normally), i.e. the process was not crashed, only stuck.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.