[GH-ISSUE #53] Windows/HIP: engine dies with 0xC0000005 on the 2nd or 3rd request (intermittent, 1.0.16 to 1.0.20) #21

Closed
opened 2026-10-29 21:19:13 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @jerem91150 on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/53

Opening this one as you asked in #6. Same machine: Windows 11, RX 7900 XTX 24 GB, 7900X3D, 64 GB RAM, TheRock ROCm 10.2.0a20260930, Unsloth UD-IQ2_XXS via --gguf-dir, my Windows build of 1.0.20 (the bits from #6, nothing else changed). I'm running Strata and Maya side by side on this box, that's where all of this comes from.

The engine just disappears, exit code 3221225477, and the server returns 503. Nothing in the engine log before it, it simply stops:

[strata] reading the prompt: 8,628 of 8,629 tokens, 29 s so far
[strata] the engine stopped unexpectedly (exit code 3221225477). The usual cause is running out of RAM ...
[strata] done: 1 tokens in 36 s (0.2 tok/s) (error, cancel=False)

To trigger it I start the server and send the same 5 requests twice: two short scene prompts (1,259 tokens in, 600 out, temp 0.3), a 9K prompt, a 27K one, then a scene prompt at temp 0.85. It almost always goes down on the 2nd or 3rd request, right at the end of the prompt read or in the first ~40 tokens. If it gets through the first five it finishes fine.

I ran 8 sessions in a row on 1.0.20, alternating:

  • defaults + the 100500 hipBLASLt table: 3 crashes out of 4
  • same with DISK_QD=16 and READ_CHUNKS=1: 2 out of 4

On 1.0.16 earlier that day it was 1 out of 5. It got worse through the afternoon, and startup went from 36 s to 179 s over the same time.

I first thought it was RAM because free RAM had hit 0 in one of the crashes, but no: it also crashed with 19 GB free (RAM tier capped at 24 GB with STRATA_GLM_RAM_GB), and other sessions went through with 3 GB free. Raising STRATA_GLM_RAM_HEADROOM_GB to 14 didn't change anything. It's not the prefill budget either (happens with the default), and the disk queue depth doesn't matter per the counts above. I think the PREFILL_MB=4096 crash from #6 was this same thing.

One thing I noticed, can't say more than that: most crashing sessions start slow, lots of disk reads and a low VRAM hit rate, sometimes with the "waiting > 10 s" line, while the good ones are around 60% VRAM hits from the first answer. One crash didn't fit though (first answer at 5.6 tok/s, 63% hits).

crash:  glm stat: decode 304.75 ms/tok (3.28 tok/s) | vram hit 33.39% | ... disk 94.81 reads/tok
        glm fast: token 1532 waiting > 10 s - CUDA0 last route seq 31163, last answer 31162
pass:   glm stat: decode 128.04 ms/tok (7.81 tok/s) | vram hit 57.90% | ... disk 28.42 reads/tok

So if I had to guess, something on the host side while experts get promoted/demoted, maybe the in-flight demotions served from RAM from #24? The CPU lane was on in some crashing runs and off in others, so probably not just that.

I can turn on Windows local dumps for strata.exe and send one, and I have the full engine and server logs of a crashing session if they help.

Originally created by @jerem91150 on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/53 Opening this one as you asked in #6. Same machine: Windows 11, RX 7900 XTX 24 GB, 7900X3D, 64 GB RAM, TheRock ROCm 10.2.0a20260930, Unsloth UD-IQ2_XXS via --gguf-dir, my Windows build of 1.0.20 (the bits from #6, nothing else changed). I'm running Strata and Maya side by side on this box, that's where all of this comes from. The engine just disappears, exit code 3221225477, and the server returns 503. Nothing in the engine log before it, it simply stops: ``` [strata] reading the prompt: 8,628 of 8,629 tokens, 29 s so far [strata] the engine stopped unexpectedly (exit code 3221225477). The usual cause is running out of RAM ... [strata] done: 1 tokens in 36 s (0.2 tok/s) (error, cancel=False) ``` To trigger it I start the server and send the same 5 requests twice: two short scene prompts (1,259 tokens in, 600 out, temp 0.3), a 9K prompt, a 27K one, then a scene prompt at temp 0.85. It almost always goes down on the 2nd or 3rd request, right at the end of the prompt read or in the first ~40 tokens. If it gets through the first five it finishes fine. I ran 8 sessions in a row on 1.0.20, alternating: - defaults + the 100500 hipBLASLt table: 3 crashes out of 4 - same with DISK_QD=16 and READ_CHUNKS=1: 2 out of 4 On 1.0.16 earlier that day it was 1 out of 5. It got worse through the afternoon, and startup went from 36 s to 179 s over the same time. I first thought it was RAM because free RAM had hit 0 in one of the crashes, but no: it also crashed with 19 GB free (RAM tier capped at 24 GB with STRATA_GLM_RAM_GB), and other sessions went through with 3 GB free. Raising STRATA_GLM_RAM_HEADROOM_GB to 14 didn't change anything. It's not the prefill budget either (happens with the default), and the disk queue depth doesn't matter per the counts above. I think the PREFILL_MB=4096 crash from #6 was this same thing. One thing I noticed, can't say more than that: most crashing sessions start slow, lots of disk reads and a low VRAM hit rate, sometimes with the "waiting > 10 s" line, while the good ones are around 60% VRAM hits from the first answer. One crash didn't fit though (first answer at 5.6 tok/s, 63% hits). ``` crash: glm stat: decode 304.75 ms/tok (3.28 tok/s) | vram hit 33.39% | ... disk 94.81 reads/tok glm fast: token 1532 waiting > 10 s - CUDA0 last route seq 31163, last answer 31162 pass: glm stat: decode 128.04 ms/tok (7.81 tok/s) | vram hit 57.90% | ... disk 28.42 reads/tok ``` So if I had to guess, something on the host side while experts get promoted/demoted, maybe the in-flight demotions served from RAM from #24? The CPU lane was on in some crashing runs and off in others, so probably not just that. I can turn on Windows local dumps for strata.exe and send one, and I have the full engine and server logs of a crashing session if they help.
Author
Owner

@boxwrench commented on GitHub (Oct 9, 2026):

Your pattern (dies on the 2nd-3rd request, right at the end of the prompt read or in the first tokens, with plenty of free RAM and default settings) matches what we chased on Linux with an RX 7900 XT: it was a race in shared engine code, not RAM. The fix is #39 (rebased on current main): table updates no longer reuse pinned buffers whose copy may still be in flight, lending waits for background expert moves, and an invalid route now fails the request instead of crashing the engine. If you can build boxwrench:fix/tier-lending-races on Windows, I'd be curious whether the access violation goes away.

<!-- gh-comment-id:6083126775 --> @boxwrench commented on GitHub (Oct 9, 2026): Your pattern (dies on the 2nd-3rd request, right at the end of the prompt read or in the first tokens, with plenty of free RAM and default settings) matches what we chased on Linux with an RX 7900 XT: it was a race in shared engine code, not RAM. The fix is #39 (rebased on current main): table updates no longer reuse pinned buffers whose copy may still be in flight, lending waits for background expert moves, and an invalid route now fails the request instead of crashing the engine. If you can build `boxwrench:fix/tier-lending-races` on Windows, I'd be curious whether the access violation goes away.
Author
Owner

@jerem91150 commented on GitHub (Oct 9, 2026):

That was it, thanks!

I built your branch on Windows on top of 1.0.24 plus my Windows commit from #54, and ran the same test as before: 8 sessions in a row, a fresh start each time and the same 10 requests, alternating the default settings and DISK_QD=16.

  • before (1.0.20): 5 crashes out of 8
  • with your fix: 0 out of 8, so 80 requests without a single access violation, both settings

Parity tests still pass here (glm_hc/kda/ffn/dsa, glm_model_test with the same numbers, sampler_parity, hip_glm_prefill_attention).

Two things I ran into on the way, in case they help:

  • hip_glm_handoff fails on Windows with "GLM request visibility timeout: cpu=0 round=1", so it never gets to your new NaN/Inf checks. It did the same before your PR, so it looks like the host polling the mapped ring doesn't see the device write under Windows in that test, even though the real engine works fine.
  • 1.0.24 doesn't build on Windows as is: generate.cpp calls setenv("STRATA_GLM_KV_INT8", "1", 0) for --kv int8 and MSVC's CRT has no setenv. Using the file's own set_env helper (with a getenv check to keep the no-overwrite behaviour) fixes it. I'll add that to #54.
<!-- gh-comment-id:6085260928 --> @jerem91150 commented on GitHub (Oct 9, 2026): That was it, thanks! I built your branch on Windows on top of 1.0.24 plus my Windows commit from #54, and ran the same test as before: 8 sessions in a row, a fresh start each time and the same 10 requests, alternating the default settings and DISK_QD=16. - before (1.0.20): 5 crashes out of 8 - with your fix: 0 out of 8, so 80 requests without a single access violation, both settings Parity tests still pass here (glm_hc/kda/ffn/dsa, glm_model_test with the same numbers, sampler_parity, hip_glm_prefill_attention). Two things I ran into on the way, in case they help: - hip_glm_handoff fails on Windows with "GLM request visibility timeout: cpu=0 round=1", so it never gets to your new NaN/Inf checks. It did the same before your PR, so it looks like the host polling the mapped ring doesn't see the device write under Windows in that test, even though the real engine works fine. - 1.0.24 doesn't build on Windows as is: generate.cpp calls `setenv("STRATA_GLM_KV_INT8", "1", 0)` for --kv int8 and MSVC's CRT has no setenv. Using the file's own set_env helper (with a getenv check to keep the no-overwrite behaviour) fixes it. I'll add that to #54.
Author
Owner

@mw00 commented on GitHub (Oct 9, 2026):

Fixed in v1.0.27 by #39: 0 crashes in 8 sessions, against 5 in 8 before (your test, thank you). Your Windows build fixes from #54 are in the same release. Closing. If it comes back on v1.0.27, please reopen.

The hip_glm_handoff visibility timeout on Windows is still open. It looks like the test's own polling of the mapped ring, since the real engine runs fine.

<!-- gh-comment-id:6088022299 --> @mw00 commented on GitHub (Oct 9, 2026): Fixed in v1.0.27 by #39: 0 crashes in 8 sessions, against 5 in 8 before (your test, thank you). Your Windows build fixes from #54 are in the same release. Closing. If it comes back on v1.0.27, please reopen. The `hip_glm_handoff` visibility timeout on Windows is still open. It looks like the test's own polling of the mapped ring, since the real engine runs fine.
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#21
No description provided.