[GH-ISSUE #4304] [Engine] 0.1.51 CUDA sm_86 (RTX 3090, UD-Q4_K_XL): after 2 days of serving, every prompt ≥20K tokens ends non-finite (#879) until a restart — NaN in the 5-token short-read tail #1902

Closed
opened 2026-11-04 01:55:10 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @miomao656 on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4304

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

Expected: /v1/chat/completions keeps answering long prompts on a server that has been up for days.

Actual: after 2 d 23 h of continuous serving (~2,800 requests), the first request whose prompt reached 61,552 tokens ended with non-finite logits (#879), and from that moment every prompt over ~20K tokens failed the same way, while short prompts kept answering normally. The automatic retry failed identically. Restarting the engine cleared it immediately; the same 99,871-token prompt then returned 200.

The client received:

503: the model's output became non-finite (NaN) twice in a row (#879); the engine has dropped its cached state - send the request again

Per-request log lines:

[strata] reading the prompt: 61,547 of 61,552 tokens, 35 s so far
[strata] the engine's logits became non-finite before the first token (#879); it dropped its cached state: sending the request again once
[strata] reading the prompt: 61,547 of 61,552 tokens, 70 s so far
[strata] the engine's logits became non-finite again on the retry (#879): the request ends with an error
[strata] done: 0 tokens in 70 s (no speed) (error, cancel=False), expert cache 47.0% hit (+10.3% of the routed experts over PCIe)
[strata] 503: the model's output became non-finite (NaN) twice in a row (#879); the engine has dropped its cached state - send the request again

Two things stand out:

  • 5 tokens are held back (61,547 of 61,552; 99,866 of 99,871 in the synthetic case below) and the NaN appears exactly there — the same "short-read tail" signature reported in #3465.
  • The automatic retry also stops 5 short: it does re-read from 0 (reading the prompt: 8,192 of 99,871 … 99,866 of 99,871) but ends at the same tail and dies the same way. So the 0.2.2 change described in #3465 ("the retry reads the whole prompt batched, like --short-read 0 for that request") does not appear to be active in this build, or does not reach this path.

Smallest steps or command that reproduce it

Not reproducible from a cold start — it needed ~2,800 requests over ~3 days. Once the engine is in this state, an arbitrary synthetic long prompt reproduces it 100%, so the prompt content is not the trigger:

python3 - <<'PY'
import json, random
random.seed(7)
words = ["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu"]
filler = " ".join(random.choice(words) for _ in range(12))
body = "\n".join(f"Line {i}: the {filler}." for i in range(4200))
req = {"model": "qwen3.8-flash-next", "max_tokens": 32,
       "messages": [{"role": "user",
                     "content": body + "\n\nQuestion: what is the last line number above? Answer with the number only."}]}
open("/tmp/long.json", "w").write(json.dumps(req))
PY

curl -s -H "Authorization: Bearer <key>" -H "Content-Type: application/json" \
     http://127.0.0.1:8080/v1/chat/completions -d @/tmp/long.json

~99,871 prompt tokens, no tools, no cache reuse, random filler.

  • Degenerate engine: 503 after two attempts (115 s), done: 0 tokens.
  • Same body after a restart: 200, 32 tokens, prompt 1,585.7 tok/s, decode 62.3 tok/s.

Reproduction status

Reproduced locally

Strata version

Strata 0.2.6 (source build at tag v0.2.6; engine/BUILD.json → "version": "0.2.6-build", "tag": "v0.2.6", "archs": [86]) · engine 0.1.51 · CUDA 13.4 · serve/server.py from the same tree

Graphics card, memory and system

RTX 3090 24 GB (sm_86, ECC N/A) · AMD Ryzen 9 7945HX3D, 94 GiB RAM · Arch Linux, kernel 7.2.11-arch1-1, NVIDIA 615.78.08 (open kernel modules) · CUDA 13.4

Model, size and settings

Qwen3.8-Flash-Next Unsloth UD-Q4_K_XL (native pack unsloth-ud-q4_k_xl), 262,144 context, pictures on, --kv fp16, --kv-resident 32768, --resident-budget-gib 64, --spec 4 --spec-min-p 0.5, --mtp, --expert-cache auto, conversation cache 8 GiB / 4 slots, --prefill auto, --short-read not overridden (default 64), --ple-io not overridden (default direct), MMQ K-quants in the build (-DSTRATA_MMQ_KQUANTS=ON).

Launch line:

/srv/strata/engine/strata --serve --pack /srv/strata/Strata-data/packs/unsloth-ud-q4_k_xl \
  --native /srv/strata/Strata-data/models/unsloth-q4kxl/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf \
  --expert-profile /srv/strata/data/expert-profile.bin --expert-cache auto --prefill auto \
  --spec 4 --spec-min-p 0.5 --mtp /srv/strata/Strata-data/mtp/rt --max-context 262144 \
  --kv fp16 --kv-resident 32768 --resident-budget-gib 64 --vision --vram-reserve-mib 700 \
  --adapt-async 1 --conversation-cache-mib 8192 --conversation-cache-slots 4 --conversation-cache-min-tokens 2048

Logs

The full engine log is 5 MB and available on request; excerpts and the measurements below are from it (2,800 parsed request blocks).

The degeneration, in order:

prompts ≥ 40K tokens before the first failure 1,184 of 1,226 answered (largest success 250,564 tokens)
last success before the failure 60,884 tokens, 410 generated, stop
first failure 61,552 tokens (same conversation, next turn)
requests ≥ 20K after the first failure 9 of 9 failed
requests < 1K after the first failure all answered (171, 613, 626 tokens)
uptime at first failure 2 d 23 h, ~2,800 requests

Same synthetic prompt, before and after a restart:

before   reading the prompt: 99,866 of 99,871 tokens, 57 s
         the engine's logits became non-finite before the first token (#879) ... retry ... again ... 503
         done: 0 tokens in 115 s (no speed) (error, cancel=False), expert cache 97.2% hit

after    reading the prompt: 99,866 of 99,871 tokens, 63 s
         done: 32 tokens in 64 s (62.3 tok/s) (length, cancel=False), expert cache 80.9% hit

Ruled out: no Xid or NVRM line in dmesg; ECC is N/A on this card; VRAM 24.0 / 24.5 GiB; GPU 78 °C / 277 W during the retry loop; no OOM kill; /health returned {"status": "ok", ...} throughout; the engine process never restarted on its own; :8080/metrics reported live.state idle between attempts.

Observed at the same time, not claimed as a cause: RAM at 85.6 of 96.2 GiB and kcompactd0 at 98 % CPU while the retry loop ran; --resident-budget-gib 64 keeps a large page-locked expert pool on this box.

What we can run on request

  • STRATA_DBG_NAN=1 on the next occurrence — this needs the engine to degenerate again (~2–3 days at this request rate), so we would have to pause our mitigation for one run
  • A/B --short-read 0 (the workaround from #3465) and --ple-io mmap (from #3602) — queued, not yet run
  • lscpu flags, the full 5 MB engine log window, strata doctor, a /metrics dump
  • The exact 99,871-token synthetic request body (random filler, no private content)
  • The failing conversation itself is a private agent session; it is not attached, but the synthetic body above reproduces the failure in the degenerate state
  • #879 — umbrella, first poison traced to the MoE output rows
  • #3465 — CUDA, deterministic NaN, bisected to the short-read tail; --short-read 0 fixed it for that reporter
  • #3638 — "after hours of serving, any batched prompt read over ~400 tokens ends non-finite, the guard's retry cannot recover it"
  • #3602 — non-finite already in the gathered/uploaded PLE embedding; --ple-io mmap passes for that reporter
  • #2519 — GDN state overflow at 16K–93K; the length dependence matches what we see
  • #2955 — open PR: the private f32→bf16 helpers mask a NaN into −0/inf, so the guard can miss it — a plausible way for a bad value to survive in cached state
  • #1892 — the guard with self-healing that this build runs

Why this is new evidence

  • First report of this family on UD-Q4_K_XL (K-quants, MMQ on) + sm_86 (RTX 3090); the deterministic reports so far are IQ3_S / IQ3_XXS on sm_89 / sm_120.
  • The degeneration is length-selective (short prompts keep working), so it is neither the "everything fails" shape of #3638 nor a content trigger like #3465.
  • The automatic retry still ends 5 tokens short in this build, so the 0.2.2 retry change did not recover this occurrence.
Originally created by @miomao656 on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4304 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened Expected: `/v1/chat/completions` keeps answering long prompts on a server that has been up for days. Actual: after **2 d 23 h of continuous serving (~2,800 requests)**, the first request whose prompt reached 61,552 tokens ended with non-finite logits (#879), and from that moment **every prompt over ~20K tokens failed the same way, while short prompts kept answering normally**. The automatic retry failed identically. Restarting the engine cleared it immediately; the same 99,871-token prompt then returned 200. The client received: ``` 503: the model's output became non-finite (NaN) twice in a row (#879); the engine has dropped its cached state - send the request again ``` Per-request log lines: ``` [strata] reading the prompt: 61,547 of 61,552 tokens, 35 s so far [strata] the engine's logits became non-finite before the first token (#879); it dropped its cached state: sending the request again once [strata] reading the prompt: 61,547 of 61,552 tokens, 70 s so far [strata] the engine's logits became non-finite again on the retry (#879): the request ends with an error [strata] done: 0 tokens in 70 s (no speed) (error, cancel=False), expert cache 47.0% hit (+10.3% of the routed experts over PCIe) [strata] 503: the model's output became non-finite (NaN) twice in a row (#879); the engine has dropped its cached state - send the request again ``` Two things stand out: - **5 tokens are held back** (61,547 of 61,552; 99,866 of 99,871 in the synthetic case below) and the NaN appears exactly there — the same "short-read tail" signature reported in #3465. - The **automatic retry also stops 5 short**: it does re-read from 0 (`reading the prompt: 8,192 of 99,871` … `99,866 of 99,871`) but ends at the same tail and dies the same way. So the 0.2.2 change described in #3465 ("the retry reads the whole prompt batched, like `--short-read 0` for that request") does not appear to be active in this build, or does not reach this path. ### Smallest steps or command that reproduce it Not reproducible from a cold start — it needed ~2,800 requests over ~3 days. **Once the engine is in this state**, an arbitrary synthetic long prompt reproduces it 100%, so the prompt content is not the trigger: ```bash python3 - <<'PY' import json, random random.seed(7) words = ["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu"] filler = " ".join(random.choice(words) for _ in range(12)) body = "\n".join(f"Line {i}: the {filler}." for i in range(4200)) req = {"model": "qwen3.8-flash-next", "max_tokens": 32, "messages": [{"role": "user", "content": body + "\n\nQuestion: what is the last line number above? Answer with the number only."}]} open("/tmp/long.json", "w").write(json.dumps(req)) PY curl -s -H "Authorization: Bearer <key>" -H "Content-Type: application/json" \ http://127.0.0.1:8080/v1/chat/completions -d @/tmp/long.json ``` ~99,871 prompt tokens, no tools, no cache reuse, random filler. - Degenerate engine: 503 after two attempts (115 s), `done: 0 tokens`. - Same body after a restart: **200**, 32 tokens, prompt 1,585.7 tok/s, decode 62.3 tok/s. ### Reproduction status Reproduced locally ### Strata version Strata **0.2.6** (source build at tag `v0.2.6`; `engine/BUILD.json` → `"version": "0.2.6-build"`, `"tag": "v0.2.6"`, `"archs": [86]`) · engine **0.1.51** · CUDA 13.4 · `serve/server.py` from the same tree ### Graphics card, memory and system RTX 3090 24 GB (sm_86, ECC N/A) · AMD Ryzen 9 7945HX3D, 94 GiB RAM · Arch Linux, kernel 7.2.11-arch1-1, NVIDIA 615.78.08 (open kernel modules) · CUDA 13.4 ### Model, size and settings Qwen3.8-Flash-Next **Unsloth UD-Q4_K_XL** (native pack `unsloth-ud-q4_k_xl`), 262,144 context, pictures on, `--kv fp16`, `--kv-resident 32768`, `--resident-budget-gib 64`, `--spec 4 --spec-min-p 0.5`, `--mtp`, `--expert-cache auto`, conversation cache 8 GiB / 4 slots, `--prefill auto`, `--short-read` **not overridden (default 64)**, `--ple-io` **not overridden (default direct)**, MMQ K-quants in the build (`-DSTRATA_MMQ_KQUANTS=ON`). Launch line: ``` /srv/strata/engine/strata --serve --pack /srv/strata/Strata-data/packs/unsloth-ud-q4_k_xl \ --native /srv/strata/Strata-data/models/unsloth-q4kxl/UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf \ --expert-profile /srv/strata/data/expert-profile.bin --expert-cache auto --prefill auto \ --spec 4 --spec-min-p 0.5 --mtp /srv/strata/Strata-data/mtp/rt --max-context 262144 \ --kv fp16 --kv-resident 32768 --resident-budget-gib 64 --vision --vram-reserve-mib 700 \ --adapt-async 1 --conversation-cache-mib 8192 --conversation-cache-slots 4 --conversation-cache-min-tokens 2048 ``` ### Logs The full engine log is 5 MB and available on request; excerpts and the measurements below are from it (2,800 parsed request blocks). **The degeneration, in order:** | | | |---|---| | prompts ≥ 40K tokens before the first failure | **1,184 of 1,226 answered** (largest success 250,564 tokens) | | last success before the failure | 60,884 tokens, 410 generated, `stop` | | first failure | 61,552 tokens (same conversation, next turn) | | requests ≥ 20K after the first failure | **9 of 9 failed** | | requests < 1K after the first failure | all answered (171, 613, 626 tokens) | | uptime at first failure | 2 d 23 h, ~2,800 requests | **Same synthetic prompt, before and after a restart:** ``` before reading the prompt: 99,866 of 99,871 tokens, 57 s the engine's logits became non-finite before the first token (#879) ... retry ... again ... 503 done: 0 tokens in 115 s (no speed) (error, cancel=False), expert cache 97.2% hit after reading the prompt: 99,866 of 99,871 tokens, 63 s done: 32 tokens in 64 s (62.3 tok/s) (length, cancel=False), expert cache 80.9% hit ``` **Ruled out:** no `Xid` or `NVRM` line in `dmesg`; ECC is N/A on this card; VRAM 24.0 / 24.5 GiB; GPU 78 °C / 277 W during the retry loop; no OOM kill; `/health` returned `{"status": "ok", ...}` throughout; the engine process never restarted on its own; `:8080/metrics` reported `live.state` `idle` between attempts. **Observed at the same time, not claimed as a cause:** RAM at 85.6 of 96.2 GiB and `kcompactd0` at 98 % CPU while the retry loop ran; `--resident-budget-gib 64` keeps a large page-locked expert pool on this box. ### What we can run on request - `STRATA_DBG_NAN=1` on the next occurrence — this needs the engine to degenerate again (~2–3 days at this request rate), so we would have to pause our mitigation for one run - A/B `--short-read 0` (the workaround from #3465) and `--ple-io mmap` (from #3602) — queued, not yet run - `lscpu` flags, the full 5 MB engine log window, `strata doctor`, a `/metrics` dump - The exact 99,871-token synthetic request body (random filler, no private content) - The failing conversation itself is a private agent session; it is not attached, but the synthetic body above reproduces the failure in the degenerate state ### Related - #879 — umbrella, first poison traced to the MoE output rows - #3465 — CUDA, deterministic NaN, bisected to the short-read tail; `--short-read 0` fixed it for that reporter - #3638 — "after hours of serving, any batched prompt read over ~400 tokens ends non-finite, the guard's retry cannot recover it" - #3602 — non-finite already in the gathered/uploaded PLE embedding; `--ple-io mmap` passes for that reporter - #2519 — GDN state overflow at 16K–93K; the length dependence matches what we see - #2955 — open PR: the private f32→bf16 helpers mask a NaN into −0/inf, so the guard can miss it — a plausible way for a bad value to survive in cached state - #1892 — the guard with self-healing that this build runs ### Why this is new evidence - First report of this family on **UD-Q4_K_XL (K-quants, MMQ on) + sm_86 (RTX 3090)**; the deterministic reports so far are IQ3_S / IQ3_XXS on sm_89 / sm_120. - The degeneration is **length-selective** (short prompts keep working), so it is neither the "everything fails" shape of #3638 nor a content trigger like #3465. - The automatic retry **still ends 5 tokens short** in this build, so the 0.2.2 retry change did not recover this occurrence.
Author
Owner

@spideytznn commented on GitHub (Oct 27, 2026):

i meet the same problem, i use the udq4kl,my pc is 5090+96G

<!-- gh-comment-id:6444895096 --> @spideytznn commented on GitHub (Oct 27, 2026): i meet the same problem, i use the udq4kl,my pc is 5090+96G
Author
Owner

@miomao656 commented on GitHub (Oct 27, 2026):

Upgrade report on the same box (the one from the first post), in case it helps triage:

Now on Strata 0.2.7 / engine 0.1.52 — source build at tag v0.2.7, sm_86, CUDA 13.4, same profile (Qwen3.8-Flash-Next UD-Q4_K_XL, 262K ctx, --kv fp16 --kv-resident 32768, --ple-io direct, --short-read default 64).

Verified after the upgrade (nothing from the NaN family in any run):

check result
standard suite, 2 runs 16K prompt 1,624 / 1,674 tok/s (0.1.51: 1,574), 16K TTFT 9.62 s, decode 66–67 tok/s
4K prompt 1,119 / 1,190 tok/s (0.1.51: 1,216)
needles 92K + 160K, depths 10/50/90 6/6 found
agentic battery (40) 37/40 first pass; both misses (R13-snail, C4-emails) passed in 2/2 repeats → effective 39/40, only the known TC2-select
functional streaming, tool call, /v1/messages, vision, 4 concurrent: all pass
non-finite lines since restart 0

Two notes relevant to this family:

  • Our profile is on --ple-io direct, so the 0.1.52 PLE-reader work (#3602) is the closest change to our failure path. If the degeneration returns I will re-run with STRATA_PLE_CHECK=1 and post the row it names.
  • The automatic retry still ended 5 tokens short in 0.1.51 (reading the prompt: 99,866 of 99,871 on both attempts), so the short-read tail path was still in play on the retry. I have not yet A/B'd --short-read 0 here (the #3465 workaround); it is the next test if this recurs.

A nightly idle-gated restart is in place on this box in the meantime, so I will report back either way once it has served a few days of long prompts on 0.1.52.

<!-- gh-comment-id:6446413669 --> @miomao656 commented on GitHub (Oct 27, 2026): Upgrade report on the same box (the one from the first post), in case it helps triage: **Now on Strata 0.2.7 / engine 0.1.52** — source build at tag `v0.2.7`, `sm_86`, CUDA 13.4, same profile (Qwen3.8-Flash-Next UD-Q4_K_XL, 262K ctx, `--kv fp16 --kv-resident 32768`, `--ple-io direct`, `--short-read` default 64). Verified after the upgrade (nothing from the NaN family in any run): | check | result | |---|---| | standard suite, 2 runs | 16K prompt **1,624 / 1,674 tok/s** (0.1.51: 1,574), 16K TTFT 9.62 s, decode 66–67 tok/s | | 4K prompt | 1,119 / 1,190 tok/s (0.1.51: 1,216) | | needles 92K + 160K, depths 10/50/90 | 6/6 found | | agentic battery (40) | 37/40 first pass; both misses (`R13-snail`, `C4-emails`) passed in 2/2 repeats → effective 39/40, only the known `TC2-select` | | functional | streaming, tool call, `/v1/messages`, vision, 4 concurrent: all pass | | non-finite lines since restart | **0** | Two notes relevant to this family: - Our profile is on `--ple-io direct`, so the 0.1.52 PLE-reader work (#3602) is the closest change to our failure path. If the degeneration returns I will re-run with `STRATA_PLE_CHECK=1` and post the row it names. - The automatic retry still ended 5 tokens short in 0.1.51 (`reading the prompt: 99,866 of 99,871` on both attempts), so the short-read tail path was still in play on the retry. I have not yet A/B'd `--short-read 0` here (the #3465 workaround); it is the next test if this recurs. A nightly idle-gated restart is in place on this box in the meantime, so I will report back either way once it has served a few days of long prompts on 0.1.52.
Author
Owner

@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:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660241812 --> @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: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1902
No description provided.