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#1106
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 @dinesh-chander on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2764
What happened
A long-context conversation cannot be served on 2× AMD RX 7900 XTX (HIP): the cold read of a ~185.6k-token document succeeds, and then every request that carries that context dies.
The run below is the 13-request conversation an agent actually produces at that context — cold read → 5 continuations → a compaction request → the post-compaction turn → an over-context probe → an "is it alive" probe → 2 concurrent re-reads — against the config I run daily (full args below):
the engine stopped unexpectedly (exit code -6)#879 non-finite#879#879, engine restarted#879#879the engine stopped unexpectedly (exit code -6)5 of 13 requests OK, 5 engine restarts. It reproduces on every config variant I tried:
--prefill auto:16384(5/13, ttft 99.6 s),--prefill auto(above), and--adapt-every 0(5/13, 3 restarts) — always the same shape: the cold read is served, the first re-read that carries the 185.6k context kills the engine, everything after that is #879. The two client-visible errors:The stall the engine reports before the kill
The kill is the engine's own 60 s no-progress watchdog, and its stall report names the stage ("issue #29" in the message): the pipelined verify window, at the very tail of the 185,756-token re-read.
Note what the stall report itself says: the expert pool is idle (42/42 jobs done, all 13 workers parked, host idle for 60 s) and no thread is waiting on disk (0 of 43 in state D). The verify window sits at position 185,615 of 185,756 — the last window of the prompt — with the GPU on ring 24 while the host has served 23. This is a GPU-synchronisation hang in the pipelined verify window, not expert or I/O starvation.
The #879 NaNs then arrive after the first kill, on requests that re-read the same context from token 0 after the reload:
So in this workload the NaN looks like it follows the crash/reload rather than being independent of it — the first failure in every run is the watchdog kill.
Control: the same conversation is clean when the optional flags are dropped
Same box, same model, same 186k context, same 13-request shape. The only difference is the set of optional engine flags: I removed
--short-read 260 --pcie-frac 0.00 --spec-min-p 0.70 --pool-workers 13 --adapt-every --adapt-async --adapt-swaps --adapt-decay --conversation-cache-mib --pipeline-windows --layer-splitand allSTRATA_*env vars, keeping only what the engine needs to load a native (IQ) pack and fit the model (--pack --native --expert-profile --expert-cache --prefill auto --spec 4 --mtp --max-context 200000 --kv int8 --kv-resident 32768 --vision --vram-reserve-mib 3072— the engine refuses to start without--spec/--prefillfor this pack, so a literally flag-free run does not exist here).Every request in that run returned 200 except the intentional over-context probe (400). So it is not "2 AMD cards cannot do long context" — the same conversation, on the same two cards, completes with the pipeline and the optional knobs out of the picture. (It is slower: 1,000 vs 1,365 tok/s prefill without the pipeline.)
For completeness, a cross-backend control: the identical 13-request conversation on the same model (NVFP4, single NVIDIA GPU, same box) is 13/13, zero restarts (cold read 185,598 tok, ttft 82.2 s, 2,257.5 tok/s).
Environment
296b59d2, tagv0.1.44.1) — HIP source buildserve/server.pyfrom the repo, enginestrata --serve--layer-split 24(also triedauto, same failure)unsloth-ud-q4_k_xl),--spec 4 --mtp, vision on CPU7.0.0-38-generic7.16.26385-0000000Engine args (shipping config):
env:
STRATA_KV_PREFETCH=1,STRATA_MTP_STAGE0=1(so this is not #2637, which is whySTRATA_MTP_STAGE0is set),STRATA_STAGE_TRIM=1,STRATA_HIPBLASLT_TUNING=<…>gfx1100-hipblaslt-100401.txt.How to reproduce
Two requests. Any prose document of ~185.6k tokens (my filler is ~1.09 tokens/word) reproduces it; the second request is the one that dies, and a single first request never fails.
After the 503 the engine is reloaded (~2–4 min on this box) and the next request that re-reads the prompt returns the #879 NaN instead. The full harness (13 requests, including the compaction turn) is
loadtest180k.py; the JSON artifacts and the full engine log for every run above are available if you want them attached.Things I checked so I would not send you a red herring
--prefill auto:16384→ same failure (5/13).--prefill auto→ same.--adapt-every 0(adaptive tier off) → same failure (5/13, 3 restarts). The tier is not it.STRATA_PF_GEMMon and off → same.--layer-split autoand--layer-split 24→ both fail at long context (autoalso produced #879 at position 39,613 on a 32k prompt).--vram-reserve-mib 2048→3072: no change for this failure (the known #267 mitigation is already in place).What I think is happening (and what I am testing next)
The dying stage is literally named
verify window (pipelined), i.e. a stage that only exists while the prefill pipeline is on — so--pipeline-windows 2is my first suspect, possibly together with the VRAM budget at that context (--kv-resident 32768+--conversation-cache-mib 8192+--vram-reserve-mib 3072left 2,806 MiB free when the failing request began). This is a different stage from the decode-side pipeline stall fixed in v0.1.42 by #1741 (that one was the device switch in the decode poll loop; this one is the verify window at the tail of a long prompt), and it is on Linux/HIP, not Windows/CUDA.I am running the single-variable version now — the shipping config with only
--pipeline-windowschanged to0— and will post the result as a comment. If it passes, that is the fix for my config; if it fails, I will bisect the remaining knobs and report which one it is.Related
--vram-reserve-mib 3072, which is not enough at 185k with the pipeline on)--pipeline-windows 2needingSTRATA_MTP_STAGE0=1on gfx1100 (set here)@dinesh-chander commented on GitHub (Oct 16, 2026):
Update — the pipeline is not the cause of the #879 tail NaNs. I ran the single-variable test I promised (this configuration with only
--pipeline-windows 2 → 0, every other arg and env var unchanged) and it never got as far as a re-read: the cold read went non-finite on all three attempts, with three distinct documents.So
--pipeline-windowsis not what produces the NaN, and I have withdrawn it as the lead. What the numbers do pin down is the shape of the failure, which is the same in every run I have:In other words: the logits of the last prompt window go non-finite, and it is a property of the configuration, not of the text (three different documents, same failure) and not of the pipeline (same failure with the pipeline off). The control from my previous update still stands — the same 186k-token conversation is 11/11 with zero restarts when the optional flags are removed — so the cause is in that set, just not
--pipeline-windows.The knobs left in that set, ordered by how directly they touch what the last prompt window reads (the prompt is far past
--kv-resident 32768, so the last window's K/V is streamed back from RAM):STRATA_KV_PREFETCH=1— the K/V prefetch across PCIe--conversation-cache-mib 8192— 8 GiB of VRAM reserved for the conversation cache (the control had none, and the shipping config had 2,806 MiB free VRAM when the failing request began)--pcie-frac 0.00--pool-workers 13— the CPU expert pool (relevant because #879's own root-cause tracing points at MoE output rows)--short-read 260,--adapt-every/--adapt-swaps/--adapt-decay,--layer-split 24,--spec-min-p 0.70A cheap repro exists, which is how I am bisecting: the shipping config's 64k cold read fails the same way (67,049 of 67,056, ~55 s of prefill instead of ~130 s), and the 32k read on the same config is clean. I am running one arm per knob at 64k, each sending distinct documents and stopping at the first failure, and will report which removal makes the tail NaNs stop.
@dinesh-chander commented on GitHub (Oct 16, 2026):
Follow-up with the bisection verdict. Method first: everything below runs one fixed 185,598-token, 13-request conversation (cold read → 5 continuations → compaction → post-compaction → over-limit → alive-after), with byte-identical documents across every arm (the harness salts documents from a fixed label), stopping at the first failure. The config is the only variable. Same rig as the report: 2×7900 XTX (gfx1100), 0.1.44.1
296b59d2, Qwen3.8-Flash-Next UD-Q4_K_XL native pack, layer split, 96 GB RAM, ROCm 7.1.The clean base — the engine-required flags plus
--pipeline-windows 2andSTRATA_MTP_STAGE0=1(i.e. your reference-style minimal serve config, hipBLASLt table as shipped): 11/11, zero restarts, ~8 separate full runs.One knob added to that base, per arm:
--conversation-cache-mib 8192,STRATA_KV_PREFETCH=1,STRATA_STAGE_TRIM=1,--short-read 260,--spec-min-p 0.70,--pcie-frac 0.19--layer-split 24--pool-workers 13--pcie-frac 0.05--pcie-frac 0.00--adapt-swaps 80 --adapt-decay 0.97 --adapt-every 1 --adapt-async 0The failing signature, both classes: the cold read dies at the prompt tail —
non-finite logits (#879) in a prompt window at position 185,59x of 185,6xx(7 tokens from the end) — while the tuned config's first failure is instead the pipelined verify window: exit −6, the stall report naming "the CPU experts of layer 22", pool idle. Every knob that breaks the clean base loads the CPU expert pool at the tail window:--pcie-frac 0.00routes 100% of VRAM-misses to the CPU (your probe picks 0.19 on this box's 7 GB/s links, and0.19is clean;0.05is borderline), the adapt group keeps the miss rate high (swap every window),--pool-workers 13shrinks the pool below the engine's own choice. The borderline arms flip between runs — the tail window sits near the pool's capacity here, and small perturbations push it over.The
--pcie-frac 0documentation pairing does not rescue it. You pair--pcie-frac 0with--adapt-every 0wherever you document it (AMD_HIP.md:186-187,AMD_HIP_PERFORMANCE.md:33, priced as a unit at:433). Both sanctioned pairings were run: the pair on the clean base fails the cold read (#879, distinct documents), and our tuned config with--adapt-every 0added still dies at continuation 2/5 with the exit −6 verify-window kill. There is no--pcie-frac 0arrangement of this rig that passes the 185k conversation.The tuned config fails with every pcie value — the value only moves the failure:
0.00/0.05pass the cold read and die at continuation 2/5 (exit −6);0.19(explicit or engine-auto) dies at the cold read (#879, 3 documents each). Dropping one aggravator doesn't fix it (shipping −--pool-workersdies at continuation 4/5; shipping − the adapt flags, which reverts to the default every-4, dies at the cold read).One more datapoint that may be the sharpest of the set. Re-tuning the shipped hipBLASLt table for this box (
tune_hipblaslt, same 43 cases) changed only 2 of 43 solution IDs — and with only the table swapped on the otherwise-identical clean base, the 185k cold read failed with #879 in 2/2 runs. GEMM solution selection alone reproducibly flips this tail NaN on a config that is otherwise rock-solid.Cross-references that now line up: #2498 (calibrate recommends
--pcie-frac 0.00and wedges a gfx1201 engine at boot — the same recommendation class, a different AMD part and a different failure), #485 (a slow link probes to a low share), #588, and #2452's tail-NaN family. The 64k failures in the original report also turned out to be state-dependent, not a length repro: on a fresh engine the shipping config serves the exact failing 64k document (200, pp 1,346.5) — the 64k failures only followed a warm 8k→16k→32k sweep on the same engine, which is why everything above runs one fixed 185k conversation instead.Artifacts, harness, and the full nightly log are on the box if any of it is useful — happy to run any arm you'd want to see (pairs of the clean knobs, or the pcie ladder at other lengths).
@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.