[GH-ISSUE #5259] [Engine] "NaN reached the router" on RTX 40 cards while reading prompts: random, ~2-5% of fresh 8K-token prompts #3128

Open
opened 2026-11-07 14:38:17 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @swolekat on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5259

Summary

With DeepSeek-V4.1-Flash split across three cards, about 1 in 35-50 fresh prompt reads of ~8K tokens fails with:

ds4: WARNING: the router met scores that are not numbers (NaN) on CUDA1 - the model's activations went non-finite; its picks are stand-ins and the answer is not reliable
[strata] the engine reported an error: the model's numbers went non-finite (NaN reached the router), so the answer would be nonsense: the request is stopped and the conversation dropped

The server answers 400 and drops the conversation. It is not reproducible from the prompt: re-sending the
byte-identical prompt that failed, read fresh, succeeds. Every failure so far was on one of the two RTX 40-series
cards (sm_89). None was seen on the RTX 5090 (sm_120). It always happens while reading the prompt, never while
generating.

System

Part Value
Strata 0.2.10 (Control 0.1.56), Windows 11 (10.0.26200)
DeepSeek engine strata-dsv41 0.1.56, 0.1.56-windows-x86_64-cuda-cuda13, source f-0291-rc1 06698c674, CUDA 13.0, archs 86/89/120
Model DeepSeek-V4.1-Flash IST-DAS-2.25bpw (ISTA-DASLab GSQ-RCO IQ2_XS)
NVIDIA driver 610.88 (GeForce, all three cards)
CPU / RAM Threadripper 9970X, 128 GB DDR5-6000 (4 channels), ASUS Pro WS TRX50-SAGE WIFI
GPUs RTX 5090 32 GB (Gen5 x16), RTX 4000 Ada 20 GB (Gen4 x8; x4 before 2026-11-04), RTX 4060 Ti 16 GB (Gen4 x8)

Engine arguments (preset deepseek-max):

--serve --pack I:\Strata-data\packs\deepseek-v4.1-flash-ist-das-2.25bpw --max-context 262144 --eos 1 --vision on
--tp 2 --reserve-mib 900 --dspark on --dspark-conf 0.5 --experts 5 --mmap-experts on --layer-split auto
gpu_roles 0=main,1=helper,2=helper  (stage order: 4060 Ti -> 4000 Ada -> 5090)

Layer split from the engine log:

ds4: CUDA0 layers [0, 42]: ...            <- RTX 4060 Ti
ds4: CUDA1 layers [11, 23]: ...           <- RTX 4000 Ada
ds4: CUDA2 layers [24, 39] + head: ...    <- RTX 5090
ds4: ... prompts in chunks of 4096

What was measured

Test Result
60 fresh ~8.8K-token prompts, default chunk (4096) 1 NaN (on CUDA1, the 4000 Ada)
Same failing prompt re-sent twice with a new first line 0 NaN
Same failing prompt re-sent byte-identical, read fresh (no cache reuse) 0 NaN
53 fresh prompts, same text, --prefill-chunk 1024 0 NaN, but prompt reading at 157 tok/s instead of 311
Earlier tuning runs (2026-11-03), 44 long fresh prompts 2 NaN: one on CUDA1 (4000 Ada), one on CUDA0 (4060 Ti)
Real use, deepseek-max, 2026-11-04 3 failed requests (prompts of 30K, 49K and 69K tokens, after a tool result)
4000 Ada moved to Gen4 x8, 20 fresh ~7.6K-token prompts, chunk 4096 1 NaN (on CUDA1, the 4000 Ada); prompt reading at ~375 tok/s instead of 311
Same, --prefill-chunk 8192 1 NaN (on CUDA1); ~345 tok/s: ~280 fewer experts fit in VRAM across the three cards

nan_probe.py (next to this file) is the probe: different slices of a TypeScript source tree, each with a unique
first line so nothing comes from the prompt cache, max_tokens: 1.

0 of 53 with the smaller chunk does not show that it fixes the problem: at this failure rate, 53 clean reads happen
by chance about a third of the time.

Hardware ruled out

  • RTX 4000 Ada VRAM: memtest_vulkan 0.5.0, 18 GB of 20 GB, ~7.5 minutes, ~70 TB written: 0 errors.
  • Temperatures: levels off at 80 °C at its 130 W limit, with no thermal or power-brake slowdowns.
  • Memory row remapping: 0 rows remapped, none pending. PCIe link: 0 replays.
  • More than one card: the same failure appeared on the 4060 Ti too. A bad card would not explain that.

Observations that may help

  • Same input, different outcome. That points at something timing-dependent: a race, a missing sync or a buffer read
    before it is filled. A numeric overflow in a kernel would fail on the same input every time.
  • Both affected cards had the slowest PCIe links in this machine (the 4000 Ada at Gen4 x4, ~7.0-7.2 GB/s while
    reading a prompt; the 4060 Ti at x8, ~14 GB/s). The 5090 has had no failures. After the 4000 Ada moved to x8 (it
    now takes in ~14 GB/s too), it still failed 2 in 40, so the slow x4 link was not the cause. A link-speed-dependent
    race in the expert upload is still possible: both cards still saturate their x8 links during a prompt read.

Searched the tracker on 2026-11-04. Nothing reports this exact case (strata-dsv41 on CUDA, RTX 40 cards, random
NaN while reading a prompt). Closest:

  • #5093 (open): in the main engine's CUDA DMA expert staging (Verifier::fetch_dma, --pcie-mode dma), an
    empty expert group publishes a later completion value while an earlier upload is still in flight, so the GPU
    reads half-old expert bytes and outputs NaN (RTX 3090, captured and replayed). Same kind of failure as here:
    random, on the expert-upload path, more likely on a slow link. It is filed against a different engine; does the
    dsv41 chunked prompt pass have the same ordering between its expert DMA and the compute that reads it?
  • #4969 (open PR): dsv41's chunked prompt pass DMAs the wrong half of the pinned expert copy on two-NUMA-node
    machines. Not this machine: one NUMA node, and the engine log reports no NUMA parts.
  • #4825 / #4350 / #5030: a dsv41 dense-dequant staging overflow on AMD gfx11 (HIP only), fixed on main.
    Not this machine's code path.

Workaround in use

Retry the request once on the 400 error. The retry has worked every time.

Originally created by @swolekat on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5259 ## Summary With DeepSeek-V4.1-Flash split across three cards, about 1 in 35-50 fresh prompt reads of ~8K tokens fails with: ``` ds4: WARNING: the router met scores that are not numbers (NaN) on CUDA1 - the model's activations went non-finite; its picks are stand-ins and the answer is not reliable [strata] the engine reported an error: the model's numbers went non-finite (NaN reached the router), so the answer would be nonsense: the request is stopped and the conversation dropped ``` The server answers 400 and drops the conversation. **It is not reproducible from the prompt:** re-sending the byte-identical prompt that failed, read fresh, succeeds. Every failure so far was on one of the two RTX 40-series cards (sm_89). None was seen on the RTX 5090 (sm_120). It always happens while reading the prompt, never while generating. ## System |Part|Value| |---|---| |Strata|0.2.10 (Control 0.1.56), Windows 11 (10.0.26200)| |DeepSeek engine|`strata-dsv41` 0.1.56, `0.1.56-windows-x86_64-cuda-cuda13`, source `f-0291-rc1 06698c674`, CUDA 13.0, archs 86/89/120| |Model|DeepSeek-V4.1-Flash IST-DAS-2.25bpw (ISTA-DASLab GSQ-RCO IQ2_XS)| |NVIDIA driver|610.88 (GeForce, all three cards)| |CPU / RAM|Threadripper 9970X, 128 GB DDR5-6000 (4 channels), ASUS Pro WS TRX50-SAGE WIFI| |GPUs|RTX 5090 32 GB (Gen5 x16), RTX 4000 Ada 20 GB (Gen4 x8; x4 before 2026-11-04), RTX 4060 Ti 16 GB (Gen4 x8)| Engine arguments (preset `deepseek-max`): ``` --serve --pack I:\Strata-data\packs\deepseek-v4.1-flash-ist-das-2.25bpw --max-context 262144 --eos 1 --vision on --tp 2 --reserve-mib 900 --dspark on --dspark-conf 0.5 --experts 5 --mmap-experts on --layer-split auto gpu_roles 0=main,1=helper,2=helper (stage order: 4060 Ti -> 4000 Ada -> 5090) ``` Layer split from the engine log: ``` ds4: CUDA0 layers [0, 42]: ... <- RTX 4060 Ti ds4: CUDA1 layers [11, 23]: ... <- RTX 4000 Ada ds4: CUDA2 layers [24, 39] + head: ... <- RTX 5090 ds4: ... prompts in chunks of 4096 ``` ## What was measured |Test|Result| |---|---| |60 fresh ~8.8K-token prompts, default chunk (4096)|**1 NaN** (on CUDA1, the 4000 Ada)| |Same failing prompt re-sent twice with a new first line|0 NaN| |Same failing prompt re-sent **byte-identical**, read fresh (no cache reuse)|0 NaN| |53 fresh prompts, same text, `--prefill-chunk 1024`|0 NaN, but prompt reading at **157 tok/s instead of 311**| |Earlier tuning runs (2026-11-03), 44 long fresh prompts|2 NaN: one on CUDA1 (4000 Ada), one on CUDA0 (4060 Ti)| |Real use, `deepseek-max`, 2026-11-04|3 failed requests (prompts of 30K, 49K and 69K tokens, after a tool result)| |4000 Ada moved to Gen4 x8, 20 fresh ~7.6K-token prompts, chunk 4096|**1 NaN** (on CUDA1, the 4000 Ada); prompt reading at ~375 tok/s instead of 311| |Same, `--prefill-chunk 8192`|**1 NaN** (on CUDA1); ~345 tok/s: ~280 fewer experts fit in VRAM across the three cards| `nan_probe.py` (next to this file) is the probe: different slices of a TypeScript source tree, each with a unique first line so nothing comes from the prompt cache, `max_tokens: 1`. 0 of 53 with the smaller chunk does not show that it fixes the problem: at this failure rate, 53 clean reads happen by chance about a third of the time. ## Hardware ruled out - **RTX 4000 Ada VRAM:** memtest_vulkan 0.5.0, 18 GB of 20 GB, ~7.5 minutes, ~70 TB written: 0 errors. - **Temperatures:** levels off at 80 °C at its 130 W limit, with no thermal or power-brake slowdowns. - **Memory row remapping:** 0 rows remapped, none pending. **PCIe link:** 0 replays. - **More than one card:** the same failure appeared on the 4060 Ti too. A bad card would not explain that. ## Observations that may help - Same input, different outcome. That points at something timing-dependent: a race, a missing sync or a buffer read before it is filled. A numeric overflow in a kernel would fail on the same input every time. - Both affected cards had the slowest PCIe links in this machine (the 4000 Ada at Gen4 x4, ~7.0-7.2 GB/s while reading a prompt; the 4060 Ti at x8, ~14 GB/s). The 5090 has had no failures. After the 4000 Ada moved to x8 (it now takes in ~14 GB/s too), it still failed 2 in 40, so the slow x4 link was not the cause. A link-speed-dependent race in the expert upload is still possible: both cards still saturate their x8 links during a prompt read. ## Related issues Searched the tracker on 2026-11-04. Nothing reports this exact case (strata-dsv41 on CUDA, RTX 40 cards, random NaN while reading a prompt). Closest: - **#5093** (open): in the main engine's CUDA DMA expert staging (`Verifier::fetch_dma`, `--pcie-mode dma`), an empty expert group publishes a later completion value while an earlier upload is still in flight, so the GPU reads half-old expert bytes and outputs NaN (RTX 3090, captured and replayed). Same kind of failure as here: random, on the expert-upload path, more likely on a slow link. It is filed against a different engine; does the dsv41 chunked prompt pass have the same ordering between its expert DMA and the compute that reads it? - **#4969** (open PR): dsv41's chunked prompt pass DMAs the wrong half of the pinned expert copy on two-NUMA-node machines. Not this machine: one NUMA node, and the engine log reports no NUMA parts. - **#4825 / #4350 / #5030**: a dsv41 dense-dequant staging overflow on AMD gfx11 (HIP only), fixed on `main`. Not this machine's code path. ## Workaround in use Retry the request once on the 400 error. The retry has worked every time.
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#3128
No description provided.