[GH-ISSUE #3036] [Engine] Windows/WDDM: parked-conversation snapshot copies corrupt at 262144 -> all-logits NaN (#879 symptom, separate trigger) #1217

Open
opened 2026-11-04 01:49:26 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @denis-1337 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3036

Area

Engine

Desktop app, Terminal or source?

Terminal (serve/server.py + engine); the fix is built from source.

What happened

With --kv int8 --max-context 262144 --expert-cache auto and the default checkpoints/prompt cache, after roughly 6–10 unique prompts have parked, the engine logs

checkpoint save: conversation snapshot running-state copy: invalid argument

and every later request fails with "the model's output became non-finite (NaN)". Same config at --max-context 196608: clean. Same 262144 with --prompt-cache 0: clean. The same model files and settings on Linux on this PC: clean. A reference PC with the same GPU, driver and Windows runs this config on auto without problems, so this is the allocation map on this machine, not a broken driver.

Smallest steps or command that reproduce it

  1. Windows 11, RX 9070 XT, Strata 0.2.0-beta, IQ3_S model.
  2. serve/server.py --engine strata --port 1235 --config <cfg> with engine args --kv int8 --max-context 262144 --expert-cache auto --spec 4 (default checkpoints/prompt cache, tuning table tools/hip/gfx1201-hipblaslt-100500.txt).
  3. Send 11 unique ~1.5k-token prompts sequentially.

Expected: 11/11 OK. Actual: OK=0 ERR=11, engine log shows the checkpoint copy error, 43 non-finite events.

Reproduction status

Reproduced locally. Re-tested on 0.2.0-beta (2026-10-19): still reproduces, both on the official install (prebuilt engine) and on a HIP build of the 0.2.0-beta source: OK=0 ERR=11, nf=43.

Strata version

0.2.0-beta (prebuilt HIP engine 0.1.45; the 0.2.0-beta source is engine 0.1.45.3, src/core/conversation_state.cpp unchanged from 0.1.45). Also reproduced on 0.1.45.

Graphics card, memory and system

AMD RX 9070 XT 16 GB (gfx1201), i7-8700K (PCIe 3), 64 GB RAM, Windows 11 Pro build 26300, AMD driver 32.0.32015.2008 (2026-09-28), Intel iGPU drives the desktop.

Model, size and settings

Qwen3.8-Flash-Next IQ3_S (GSQ-RCO pack), --kv int8 --max-context 262144 --expert-cache auto --spec 4, hipBLASLt tuning table enabled.

Logs

Engine: checkpoint save: conversation snapshot running-state copy: invalid argument. A copy probe added to a 0.1.45 build shows the refused transfer: conv copy fail: dst=0x275B65060 src=0x400374200 bytes=117669888: invalid argument — the 112 MB GDN running state, device→host. The error is sticky: the next capture reports invalid argument even though the failing call already returned.

Root cause and fix (PR #3037)

The GB-scale synchronous snapshot copies use heap destinations. On Windows/WDDM the HIP runtime misclassifies C++ heap pointers as pinned host memory: the direct copy is refused (the error above) or, when accepted, interleaves with expert H2D streaming on the copy engine — bytes land wrong, decode windows read garbage as expert weights, and the grouped GEMM writes NaN. PR #3037 stages every synchronous snapshot copy through a real pinned 16 MiB buffer (device→pinned via the copy engine, pinned→destination via memcpy) and passes the copy direction explicitly instead of relying on pointer classification. Opt-out: STRATA_CKPT_STAGE_FIRST=0.

Verification on 0.2.0-beta (this rig)

  • Unpatched HIP build of 0.2.0-beta source (main @ e88ee39d): park-unique 11 prompts → OK=0 ERR=11, nf=43 (bug present).
  • Same build with the PR patch: park-unique rounds OK=11 ERR=0, 0 non-finite (see PR #3037 Validation for exact rounds).

Note: this issue and the accompanying PR were prepared by an AI agent (Qwen3.8-Flash-Next IQ3_S, served by Strata itself) together with the account owner.

Originally created by @denis-1337 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3036 ### Area Engine ### Desktop app, Terminal or source? Terminal (`serve/server.py` + engine); the fix is built from source. ### What happened With `--kv int8 --max-context 262144 --expert-cache auto` and the default checkpoints/prompt cache, after roughly 6–10 unique prompts have parked, the engine logs ``` checkpoint save: conversation snapshot running-state copy: invalid argument ``` and every later request fails with "the model's output became non-finite (NaN)". Same config at `--max-context 196608`: clean. Same 262144 with `--prompt-cache 0`: clean. The same model files and settings on Linux on this PC: clean. A reference PC with the same GPU, driver and Windows runs this config on auto without problems, so this is the allocation map on this machine, not a broken driver. ### Smallest steps or command that reproduce it 1. Windows 11, RX 9070 XT, Strata 0.2.0-beta, IQ3_S model. 2. `serve/server.py --engine strata --port 1235 --config <cfg>` with engine args `--kv int8 --max-context 262144 --expert-cache auto --spec 4` (default checkpoints/prompt cache, tuning table `tools/hip/gfx1201-hipblaslt-100500.txt`). 3. Send 11 unique ~1.5k-token prompts sequentially. Expected: 11/11 OK. Actual: `OK=0 ERR=11`, engine log shows the checkpoint copy error, 43 non-finite events. ### Reproduction status Reproduced locally. Re-tested on 0.2.0-beta (2026-10-19): still reproduces, both on the official install (prebuilt engine) and on a HIP build of the 0.2.0-beta source: `OK=0 ERR=11`, nf=43. ### Strata version 0.2.0-beta (prebuilt HIP engine 0.1.45; the 0.2.0-beta source is engine 0.1.45.3, `src/core/conversation_state.cpp` unchanged from 0.1.45). Also reproduced on 0.1.45. ### Graphics card, memory and system AMD RX 9070 XT 16 GB (gfx1201), i7-8700K (PCIe 3), 64 GB RAM, Windows 11 Pro build 26300, AMD driver 32.0.32015.2008 (2026-09-28), Intel iGPU drives the desktop. ### Model, size and settings Qwen3.8-Flash-Next IQ3_S (GSQ-RCO pack), `--kv int8 --max-context 262144 --expert-cache auto --spec 4`, hipBLASLt tuning table enabled. ### Logs Engine: `checkpoint save: conversation snapshot running-state copy: invalid argument`. A copy probe added to a 0.1.45 build shows the refused transfer: `conv copy fail: dst=0x275B65060 src=0x400374200 bytes=117669888: invalid argument` — the 112 MB GDN running state, device→host. The error is sticky: the next capture reports `invalid argument` even though the failing call already returned. ### Root cause and fix (PR #3037) The GB-scale synchronous snapshot copies use heap destinations. On Windows/WDDM the HIP runtime misclassifies C++ heap pointers as pinned host memory: the direct copy is refused (the error above) or, when accepted, interleaves with expert H2D streaming on the copy engine — bytes land wrong, decode windows read garbage as expert weights, and the grouped GEMM writes NaN. PR #3037 stages every synchronous snapshot copy through a real pinned 16 MiB buffer (device→pinned via the copy engine, pinned→destination via memcpy) and passes the copy direction explicitly instead of relying on pointer classification. Opt-out: `STRATA_CKPT_STAGE_FIRST=0`. ### Verification on 0.2.0-beta (this rig) - Unpatched HIP build of 0.2.0-beta source (`main` @ e88ee39d): park-unique 11 prompts → `OK=0 ERR=11`, nf=43 (bug present). - Same build with the PR patch: park-unique rounds `OK=11 ERR=0`, 0 non-finite (see PR #3037 Validation for exact rounds). Note: this issue and the accompanying PR were prepared by an AI agent (Qwen3.8-Flash-Next IQ3_S, served by Strata itself) together with the account owner.
Author
Owner

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

  1. Re-test on 0.2.0-beta. 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:6271430972 --> @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: 1. Re-test on 0.2.0-beta. 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).
Author
Owner

@denis-1337 commented on GitHub (Oct 19, 2026):

/reopen

<!-- gh-comment-id:6279707918 --> @denis-1337 commented on GitHub (Oct 19, 2026): /reopen
Author
Owner

@github-actions[bot] commented on GitHub (Oct 19, 2026):

Reopened, thank you. A maintainer will pick it up from here.

<!-- gh-comment-id:6279710163 --> @github-actions[bot] commented on GitHub (Oct 19, 2026): Reopened, thank you. A maintainer will pick it up from here.
Author
Owner

@denis-1337 commented on GitHub (Oct 31, 2026):

Re-tested on the current 0.2.9 line (main @ c62d5e3a, HIP build, same rig and script): the bug still reproduces - OK=1 ERR=10, 49 non-finite events. With the PR patch: 2/2 rounds OK=11 ERR=0, 0 non-finite. PR #3288 rebased and updated; the fix now covers the K/V copies too (they turned out to be a second carrier on the reworked park path).

<!-- gh-comment-id:6544903134 --> @denis-1337 commented on GitHub (Oct 31, 2026): Re-tested on the current 0.2.9 line (`main` @ c62d5e3a, HIP build, same rig and script): the bug still reproduces - `OK=1 ERR=10`, 49 non-finite events. With the PR patch: 2/2 rounds `OK=11 ERR=0`, 0 non-finite. PR #3288 rebased and updated; the fix now covers the K/V copies too (they turned out to be a second carrier on the reworked park path).
Author
Owner

@denis-1337 commented on GitHub (Oct 31, 2026):

Cross-link for triage: the fix is PR #3288, and a short triage note (why this report carries weight, plus the sibling reports on the same path — #4304, #3431, #4144, each with its differing root cause spelled out) is at https://github.com/Niko1221/Strata/pull/3288#issuecomment-6545473118. No need to read both; the PR comment is the summary.

<!-- gh-comment-id:6545528771 --> @denis-1337 commented on GitHub (Oct 31, 2026): Cross-link for triage: the fix is PR #3288, and a short triage note (why this report carries weight, plus the sibling reports on the same path — #4304, #3431, #4144, each with its differing root cause spelled out) is at https://github.com/Niko1221/Strata/pull/3288#issuecomment-6545473118. No need to read both; the PR comment is the summary.
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#1217
No description provided.