[GH-ISSUE #1468] prefill copy_i32: illegal memory access on long prompts when the prefill chunk is large (auto:32768) #588

Closed
opened 2026-11-04 01:44:16 +07:00 by bsakaguchi · 23 comments
Owner

Originally created by @btc1000w on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1468

Summary

prefill copy_i32 faults with an illegal memory access on long prompts when the prefill chunk is large, then check() calls std::exit(1) and the engine dies (the server restarts it, ~100 s). It is intermittent (the same prompt sometimes succeeds) and reproduces on both 0.1.40 and 0.1.40.2.

The chunk size is the isolated variable:

--prefill actual chunk requests crashes
auto:32768 19,200-20,480 45 11 (~35 %)
8192 8,192 20 0
auto:16384 16,384 16 0

Removing --pipeline-windows did not stop it (1 crash in 4 requests), so it is not that path.

Where it fails

src/prefill/kernels.cu:70    void check(const char* what) {
                                 const cudaError_t e = cudaGetLastError();
                                 if (e != cudaSuccess) { std::fprintf(stderr, "prefill %s: %s\n", what,
                                     cudaGetErrorString(e)); std::exit(1); }
                             }
src/prefill/kernels.cu:1677  __global__ void copy_i32_kernel(int32_t* dst, const int32_t* src, int64_t n)
src/prefill/kernels.cu:1695  void copy_i32(int32_t* dst, const int32_t* src, int64_t n, void* stream) {
                                 ... copy_i32_kernel<<<min((n+255)/256, 256), 256, 0, stream>>>(dst, src, n);
                                 check("copy_i32");
                             }

Call sites (all pass T * K int32, T = chunk, K = top-k):

src/prefill/prefill.cpp:2694  if (grp_mapped) copy_i32(m.grp_dev, m.ids, T * K, m.cs);
src/prefill/prefill.cpp:2829  copy_i32(m.slot_dev, m.grp_dev + m.grp_tk, T * K, m.cs);
src/prefill/prefill.cpp:2830  copy_i32(m.src_dev, m.grp_dev + 2 * m.grp_tk, T * K, m.cs);

The engine log line is exactly:

prefill copy_i32: an illegal memory access was encountered

then the server logs engine started: ... (a fresh engine), so the request is lost and the model reloads.

Reproduce

Engine 0.1.40 (and 0.1.40.2), Windows:

strata.exe --serve --pack <iq3_xxs pack> --native <shard1> --ple-gguf <shard2> \
  --expert-profile data/expert-profile.bin --expert-cache auto \
  --prefill auto:32768 --spec 4 --spec-min-p 0.70 --mtp <mtp/rt> \
  --max-context 262144 --kv int8 --kv-resident 32768 --vision \
  --vram-reserve-mib 690 --pool-workers 8 --trim-stage-weights \
  --pipeline-windows 2 --layer-split 26

Send a prompt of ~54 K-114 K tokens. The engine logs prompt chunk auto: 19968 tokens, a 512-slot ring at startup, then crashes within a few long-prompt requests. --prefill auto:16384 (or 8192) is stable.

Environment

  • Engine: 0.1.40 and 0.1.40.2 (BUILD.json, CUDA 13.0, archs 75/86/89/120 + PTX), source: release
  • GPUs: RTX 3080 Laptop 16 GB + RTX 3070 Laptop 16 GB, driver 616.56, --layer-split 26 (2 stages)
  • CPU: Intel Xeon E5-2680 v4 (14c/28t), 95.8 GiB RAM, Windows
  • Model: Qwen3.8-Flash-Next-GSQ-RCO-abliterated-IQ3_XXS (47.3 GB shard1 + 28.8 GB shard2, mixed expert types: IQ3_S/IQ4_NL/Q2_0/IQ2_S/IQ2_XS/IQ2_XXS/IQ3_XXS)
  • Pack: native_experts.txt regenerated with tools/iq_pack.py --skip-experts for this image (so the expert offsets match); dense.bin/index.txt are byte-identical to before
  • Other settings: --trim-stage-weights, --pipeline-windows 2, --kv int8 --kv-resident 32768, --spec 4 --spec-min-p 0.70, STRATA_PREFILL_RING=1024, vision encoder on the CPU (vision.gpu=false)

Question

Is there a buffer in the prefill MoE path sized for a smaller T than the configured chunk, or a bound that T * K can exceed when the chunk is large? The failure being intermittent at the same prompt suggests a size/offset edge rather than a constant out-of-range pointer.

I can attach the engine's own stall dumps (strata-stall-*.dmp, written by the issue #29 watchdog) if that helps.

Originally created by @btc1000w on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1468 ## Summary `prefill copy_i32` faults with an **illegal memory access** on **long prompts when the prefill chunk is large**, then `check()` calls `std::exit(1)` and the engine dies (the server restarts it, ~100 s). It is **intermittent** (the same prompt sometimes succeeds) and **reproduces on both 0.1.40 and 0.1.40.2**. The chunk size is the isolated variable: | `--prefill` | actual chunk | requests | crashes | |---|---:|---:|---:| | `auto:32768` | 19,200-20,480 | 45 | **11 (~35 %)** | | `8192` | 8,192 | 20 | **0** | | `auto:16384` | 16,384 | 16 | **0** | Removing `--pipeline-windows` did **not** stop it (1 crash in 4 requests), so it is not that path. ## Where it fails ``` src/prefill/kernels.cu:70 void check(const char* what) { const cudaError_t e = cudaGetLastError(); if (e != cudaSuccess) { std::fprintf(stderr, "prefill %s: %s\n", what, cudaGetErrorString(e)); std::exit(1); } } src/prefill/kernels.cu:1677 __global__ void copy_i32_kernel(int32_t* dst, const int32_t* src, int64_t n) src/prefill/kernels.cu:1695 void copy_i32(int32_t* dst, const int32_t* src, int64_t n, void* stream) { ... copy_i32_kernel<<<min((n+255)/256, 256), 256, 0, stream>>>(dst, src, n); check("copy_i32"); } ``` Call sites (all pass `T * K` int32, `T` = chunk, `K` = top-k): ``` src/prefill/prefill.cpp:2694 if (grp_mapped) copy_i32(m.grp_dev, m.ids, T * K, m.cs); src/prefill/prefill.cpp:2829 copy_i32(m.slot_dev, m.grp_dev + m.grp_tk, T * K, m.cs); src/prefill/prefill.cpp:2830 copy_i32(m.src_dev, m.grp_dev + 2 * m.grp_tk, T * K, m.cs); ``` The engine log line is exactly: ``` prefill copy_i32: an illegal memory access was encountered ``` then the server logs `engine started: ...` (a fresh engine), so the request is lost and the model reloads. ## Reproduce Engine 0.1.40 (and 0.1.40.2), Windows: ``` strata.exe --serve --pack <iq3_xxs pack> --native <shard1> --ple-gguf <shard2> \ --expert-profile data/expert-profile.bin --expert-cache auto \ --prefill auto:32768 --spec 4 --spec-min-p 0.70 --mtp <mtp/rt> \ --max-context 262144 --kv int8 --kv-resident 32768 --vision \ --vram-reserve-mib 690 --pool-workers 8 --trim-stage-weights \ --pipeline-windows 2 --layer-split 26 ``` Send a prompt of ~54 K-114 K tokens. The engine logs `prompt chunk auto: 19968 tokens, a 512-slot ring` at startup, then crashes within a few long-prompt requests. `--prefill auto:16384` (or `8192`) is stable. ## Environment - Engine: 0.1.40 and 0.1.40.2 (`BUILD.json`, CUDA 13.0, archs 75/86/89/120 + PTX), `source: release` - GPUs: RTX 3080 Laptop 16 GB + RTX 3070 Laptop 16 GB, driver 616.56, `--layer-split 26` (2 stages) - CPU: Intel Xeon E5-2680 v4 (14c/28t), 95.8 GiB RAM, Windows - Model: `Qwen3.8-Flash-Next-GSQ-RCO-abliterated-IQ3_XXS` (47.3 GB shard1 + 28.8 GB shard2, mixed expert types: IQ3_S/IQ4_NL/Q2_0/IQ2_S/IQ2_XS/IQ2_XXS/IQ3_XXS) - Pack: `native_experts.txt` regenerated with `tools/iq_pack.py --skip-experts` for this image (so the expert offsets match); `dense.bin`/`index.txt` are byte-identical to before - Other settings: `--trim-stage-weights`, `--pipeline-windows 2`, `--kv int8 --kv-resident 32768`, `--spec 4 --spec-min-p 0.70`, `STRATA_PREFILL_RING=1024`, vision encoder on the CPU (`vision.gpu=false`) ## Question Is there a buffer in the prefill MoE path sized for a **smaller `T`** than the configured chunk, or a bound that `T * K` can exceed when the chunk is large? The failure being intermittent at the same prompt suggests a size/offset edge rather than a constant out-of-range pointer. I can attach the engine's own stall dumps (`strata-stall-*.dmp`, written by the issue #29 watchdog) if that helps.
Author
Owner

@Momoyeyu commented on GitHub (Oct 8, 2026):

Could you share the exact GGUF repository/revision and the startup log showing the resolved prefill chunk and layer split? The report names an abliterated IQ3_XXS pack but not its source. I am preparing a reproduction and want to avoid silently substituting a different pack.

I am also preparing a model-free check of the mapped-host copy path, but that alone will not reproduce the full prefill workload: copy_i32 checks cudaGetLastError, so the reported error could also originate from earlier asynchronous GPU work. No root cause or fix confirmed yet.

<!-- gh-comment-id:6052020470 --> @Momoyeyu commented on GitHub (Oct 8, 2026): Could you share the exact GGUF repository/revision and the startup log showing the resolved prefill chunk and layer split? The report names an abliterated IQ3_XXS pack but not its source. I am preparing a reproduction and want to avoid silently substituting a different pack. I am also preparing a model-free check of the mapped-host copy path, but that alone will not reproduce the full prefill workload: copy_i32 checks cudaGetLastError, so the reported error could also originate from earlier asynchronous GPU work. No root cause or fix confirmed yet.
Author
Owner

@Niko1221 commented on GitHub (Oct 8, 2026):

Thank you for the table, it narrows it down. We could not reproduce it: a 60K-token prompt with --prefill 20480 on two Radeon AI PRO R9700 (layer split 26, experts streaming and 100% resident), three runs, and an RTX 5070 / RTX 3060 clamp the chunk below 16K because their cache cannot hold the buffers, so the 19-20K chunk could not be exercised on CUDA here. Reading the code, T * K is a 64-bit size at the three copy_i32 call sites and the grouping buffer is sized from the same T * K, so we found no overflow or undersized buffer there.

One thing that changes how to look at it: copy_i32 is the first kernel launched after a stream synchronisation, and check() reports the sticky error of the last asynchronous failure. So the illegal access most likely comes from a kernel enqueued before it, and copy_i32 is only where it surfaced. Two things would pinpoint it: run once with CUDA_LAUNCH_BLOCKING=1 (the engine then names the kernel that faulted), and tell us whether it still happens with --vision removed and without --trim-stage-weights. The stall dump you offered would also help.

Until then --prefill auto:16384 (which you found stable) is the workaround.

<!-- gh-comment-id:6059717756 --> @Niko1221 commented on GitHub (Oct 8, 2026): Thank you for the table, it narrows it down. We could not reproduce it: a 60K-token prompt with `--prefill 20480` on two Radeon AI PRO R9700 (layer split 26, experts streaming and 100% resident), three runs, and an RTX 5070 / RTX 3060 clamp the chunk below 16K because their cache cannot hold the buffers, so the 19-20K chunk could not be exercised on CUDA here. Reading the code, `T * K` is a 64-bit size at the three `copy_i32` call sites and the grouping buffer is sized from the same `T * K`, so we found no overflow or undersized buffer there. One thing that changes how to look at it: `copy_i32` is the first kernel launched after a stream synchronisation, and `check()` reports the sticky error of the last asynchronous failure. So the illegal access most likely comes from a kernel enqueued before it, and `copy_i32` is only where it surfaced. Two things would pinpoint it: run once with `CUDA_LAUNCH_BLOCKING=1` (the engine then names the kernel that faulted), and tell us whether it still happens with `--vision` removed and without `--trim-stage-weights`. The stall dump you offered would also help. Until then `--prefill auto:16384` (which you found stable) is the workaround.
Author
Owner

@Momoyeyu commented on GitHub (Oct 8, 2026):

My model-free mapped/pinned copy probe passed on an RTX 4090 D, but I have not reproduced the full-model failure. The capacity/lifecycle review at d5ea713 also did not establish an undersized grouping buffer. Neither result rules out the reported bug or identifies the kernel responsible.

I cannot currently reproduce the original environment: I do not have the exact abliterated IQ3_XXS GGUF revision/pack or the reported Windows dual-GPU setup. The available dual-GPU CUDA host is Linux and currently occupied; I also have no AMD hardware to validate HIP behavior.

Once the original model inputs and an available CUDA run are in hand, the useful next checks are the ones you requested: CUDA_LAUNCH_BLOCKING=1, then separate controls without --vision and without --trim-stage-weights, confirming the effective chunk actually reaches 19-20K. Until then I have no confirmed root cause or fix to propose; the reporter’s startup log and stall dump are still needed.

<!-- gh-comment-id:6061027827 --> @Momoyeyu commented on GitHub (Oct 8, 2026): My model-free mapped/pinned copy probe passed on an RTX 4090 D, but I have not reproduced the full-model failure. The capacity/lifecycle review at d5ea713 also did not establish an undersized grouping buffer. Neither result rules out the reported bug or identifies the kernel responsible. I cannot currently reproduce the original environment: I do not have the exact abliterated IQ3_XXS GGUF revision/pack or the reported Windows dual-GPU setup. The available dual-GPU CUDA host is Linux and currently occupied; I also have no AMD hardware to validate HIP behavior. Once the original model inputs and an available CUDA run are in hand, the useful next checks are the ones you requested: CUDA_LAUNCH_BLOCKING=1, then separate controls without --vision and without --trim-stage-weights, confirming the effective chunk actually reaches 19-20K. Until then I have no confirmed root cause or fix to propose; the reporter’s startup log and stall dump are still needed.
Author
Owner

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

Additional data point from a dual-GPU Windows laptop (RTX 3080 Laptop + RTX 3070 Laptop, 16 GB each, WDDM), Strata 0.1.41, Qwen3.8-Flash-Next IQ3_XXS (abliterated pack), layer-split 26, --prefill auto:16384, --pipeline-windows 2, --mtp-hnorm stream.

We logged 49 occurrences of prefill copy_i32: an illegal memory access was encountered over ~4 hours of heavy long-context use (prompts from ~90k to 226k tokens, chunk size 16384 every time). After each hit the engine exits and the server restarts it (~100 s recovery); no stall dumps are produced (clean exit via check()).

CUDA_LAUNCH_BLOCKING=1 (as requested above): the engine starts and prints the expected warning, but on both a 220k and a 64k prompt the prefill itself hangs indefinitely — the server's "reading the prompt: X of Y tokens" progress line freezes at the last chunk and never advances; GPU0 sits at 100 % with no further log output for 20+ minutes until the process is killed. No illegal access is ever reached under CLB=1, so the faulting kernel cannot be named this way.

STRATA_PF_STEP_SYNC=1 (the alternative the engine suggests in its own startup warning): 3/3 runs of a 211,023-token cold prompt (cache_prompt=false) completed cleanly — 0 new illegal accesses, prefill ~1994 tok/s (vs ~1941 tok/s without the flag, i.e. no measurable slowdown), decode ~34-79 tok/s, drafts accepted normally. Prompt size, layer split, and chunk size were identical to runs that crashed without the flag.

This suggests the illegal access is a race between asynchronous prefill kernels rather than a fixed-size buffer overflow: full serialization (CLB=1) turns it into a hang, but a synchronization point at each prefill step boundary (PF_STEP_SYNC=1) eliminates the fault with no performance cost. Happy to run further targeted tests (e.g. without --vision, without --trim-stage-weights, or with a specific CUDA error trap) if it would help pin the exact kernel pair.

<!-- gh-comment-id:6076523657 --> @btc1000w commented on GitHub (Oct 9, 2026): Additional data point from a dual-GPU Windows laptop (RTX 3080 Laptop + RTX 3070 Laptop, 16 GB each, WDDM), Strata 0.1.41, Qwen3.8-Flash-Next IQ3_XXS (abliterated pack), layer-split 26, --prefill auto:16384, --pipeline-windows 2, --mtp-hnorm stream. We logged 49 occurrences of `prefill copy_i32: an illegal memory access was encountered` over ~4 hours of heavy long-context use (prompts from ~90k to 226k tokens, chunk size 16384 every time). After each hit the engine exits and the server restarts it (~100 s recovery); no stall dumps are produced (clean exit via check()). **CUDA_LAUNCH_BLOCKING=1** (as requested above): the engine starts and prints the expected warning, but on both a 220k and a 64k prompt the prefill itself hangs indefinitely — the server's "reading the prompt: X of Y tokens" progress line freezes at the last chunk and never advances; GPU0 sits at 100 % with no further log output for 20+ minutes until the process is killed. No illegal access is ever reached under CLB=1, so the faulting kernel cannot be named this way. **STRATA_PF_STEP_SYNC=1** (the alternative the engine suggests in its own startup warning): 3/3 runs of a 211,023-token cold prompt (cache_prompt=false) completed cleanly — 0 new illegal accesses, prefill ~1994 tok/s (vs ~1941 tok/s without the flag, i.e. no measurable slowdown), decode ~34-79 tok/s, drafts accepted normally. Prompt size, layer split, and chunk size were identical to runs that crashed without the flag. This suggests the illegal access is a race between asynchronous prefill kernels rather than a fixed-size buffer overflow: full serialization (CLB=1) turns it into a hang, but a synchronization point at each prefill step boundary (PF_STEP_SYNC=1) eliminates the fault with no performance cost. Happy to run further targeted tests (e.g. without --vision, without --trim-stage-weights, or with a specific CUDA error trap) if it would help pin the exact kernel pair.
Author
Owner

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

I ran a bounded two-GPU CUDA control with a different IQ3_S model on Linux: four cold 211,023-token requests at a fixed 16,384-token prefill chunk without step sync, then four with STRATA_PF_STEP_SYNC=1. All eight finished without a copy_i32 error. The effective two-stage split was 26 and pipeline windows were enabled. This does not reproduce or rule out your Windows/heterogeneous-16GB-card failure: the quantization, weights, OS, and hardware differ, and four baseline requests cannot assess a rare intermittent crash.

I found a possible match for the pack named in your report: SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF, IQ3_XXS. Its first shard is 47,342,144,896 bytes (SHA-256 03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5), and its second is 28,800,138,432 bytes. Is this your exact GGUF repository/revision and first-shard hash? If not, could you provide those? I will not treat a similarly named pack as the same reproduction. The existing step-sync control alone does not identify the faulting kernel.

<!-- gh-comment-id:6081323701 --> @Momoyeyu commented on GitHub (Oct 9, 2026): I ran a bounded two-GPU CUDA control with a different IQ3_S model on Linux: four cold 211,023-token requests at a fixed 16,384-token prefill chunk without step sync, then four with STRATA_PF_STEP_SYNC=1. All eight finished without a copy_i32 error. The effective two-stage split was 26 and pipeline windows were enabled. This does not reproduce or rule out your Windows/heterogeneous-16GB-card failure: the quantization, weights, OS, and hardware differ, and four baseline requests cannot assess a rare intermittent crash. I found a possible match for the pack named in your report: SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF, IQ3_XXS. Its first shard is 47,342,144,896 bytes (SHA-256 03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5), and its second is 28,800,138,432 bytes. Is this your exact GGUF repository/revision and first-shard hash? If not, could you provide those? I will not treat a similarly named pack as the same reproduction. The existing step-sync control alone does not identify the faulting kernel.
Author
Owner

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

Confirmed: same pack, byte for byte.

First shard: 47,342,144,896 bytes, SHA-256 03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5 — exact match to your SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF IQ3_XXS numbers.
Second shard: 28,800,138,432 bytes (stored as a symlink on our side; stream length confirms the size).

So the reproduction is pinned to that exact repo/revision/quant, not a similarly named pack.

On identifying the faulting kernel beyond step-sync: understood — step-sync only proves a cross-stream race exists, it does not name the kernel. The earlier 0.1.40.3 log capture (with --prefill auto:32768) is the only run where the async fault surfaced before copy_i32's sync point:

qsa_prompt_attn_batch: an illegal memory access was encountered
prefill mmq: mul_mat_q: an illegal memory access was encountered

Both printed before any copy_i32 line, mid-chunk (layer 20 of a 16384-token chunk from token 19968). On 0.1.41 those two kernels no longer print their own error lines before copy_i32 swallows the sticky error, so the 0.1.40.3 capture is our best evidence that the race involves qsa_prompt_attn_batch and/or the mul_mat_q prompt path.

If a compute-sanitizer memcheck run (or a build with per-kernel cudaGetLastError after each prefill enqueue) on Windows + this exact IQ3_XXS pack would help narrow it further, we can run one — just say which flags you want.

<!-- gh-comment-id:6081801534 --> @btc1000w commented on GitHub (Oct 9, 2026): Confirmed: same pack, byte for byte. First shard: 47,342,144,896 bytes, SHA-256 03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5 — exact match to your SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF IQ3_XXS numbers. Second shard: 28,800,138,432 bytes (stored as a symlink on our side; stream length confirms the size). So the reproduction is pinned to that exact repo/revision/quant, not a similarly named pack. On identifying the faulting kernel beyond step-sync: understood — step-sync only proves a cross-stream race exists, it does not name the kernel. The earlier 0.1.40.3 log capture (with --prefill auto:32768) is the only run where the async fault surfaced before copy_i32's sync point: qsa_prompt_attn_batch: an illegal memory access was encountered prefill mmq: mul_mat_q: an illegal memory access was encountered Both printed before any copy_i32 line, mid-chunk (layer 20 of a 16384-token chunk from token 19968). On 0.1.41 those two kernels no longer print their own error lines before copy_i32 swallows the sticky error, so the 0.1.40.3 capture is our best evidence that the race involves qsa_prompt_attn_batch and/or the mul_mat_q prompt path. If a compute-sanitizer memcheck run (or a build with per-kernel cudaGetLastError after each prefill enqueue) on Windows + this exact IQ3_XXS pack would help narrow it further, we can run one — just say which flags you want.
Author
Owner

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

Thanks for confirming the exact SC117 IQ3_XXS shard hash. I am preparing that pinned GGUF and a separate native pack for the next Linux CUDA run; my earlier 4+4 controls used a different IQ3_S model, so they do not bear on this pack.

The older qsa_prompt_attn_batch / prefill mmq: mul_mat_q lines are helpful for where to instrument, but both paths also read CUDA last-error state, so I cannot yet assign the fault to either kernel from their order alone. The step-sync result is evidence of scheduling sensitivity, not proof of a particular cross-stream race.

Could you try the two maintainer-requested controls separately on your existing failing 16K-chunk configuration, without STRATA_PF_STEP_SYNC or CUDA_LAUNCH_BLOCKING: (1) omit --vision, retain --trim-stage-weights; (2) retain --vision, omit --trim-stage-weights? Please record the actual chunk, request count and any failure for each. If convenient after those, a third separate control is STRATA_PROMPT_ATTN_OLD=1, which selects the fallback QSA attention implementation without changing the MMQ flag; that is a diagnostic, not a proposed fix, and may change speed/output. No need to let a hung request run indefinitely. I would defer compute-sanitizer until we have a narrower failing path, since instrumentation may mask an intermittent scheduling-sensitive fault.

<!-- gh-comment-id:6082097418 --> @Momoyeyu commented on GitHub (Oct 9, 2026): Thanks for confirming the exact SC117 IQ3_XXS shard hash. I am preparing that pinned GGUF and a separate native pack for the next Linux CUDA run; my earlier 4+4 controls used a different IQ3_S model, so they do not bear on this pack. The older qsa_prompt_attn_batch / prefill mmq: mul_mat_q lines are helpful for where to instrument, but both paths also read CUDA last-error state, so I cannot yet assign the fault to either kernel from their order alone. The step-sync result is evidence of scheduling sensitivity, not proof of a particular cross-stream race. Could you try the two maintainer-requested controls separately on your existing failing 16K-chunk configuration, without STRATA_PF_STEP_SYNC or CUDA_LAUNCH_BLOCKING: (1) omit --vision, retain --trim-stage-weights; (2) retain --vision, omit --trim-stage-weights? Please record the actual chunk, request count and any failure for each. If convenient after those, a third separate control is STRATA_PROMPT_ATTN_OLD=1, which selects the fallback QSA attention implementation without changing the MMQ flag; that is a diagnostic, not a proposed fix, and may change speed/output. No need to let a hung request run indefinitely. I would defer compute-sanitizer until we have a narrower failing path, since instrumentation may mask an intermittent scheduling-sensitive fault.
Author
Owner

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

Exact-pack reproduction attempt on different hardware: reporter-confirmed SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF IQ3_XXS at rev eec4e10 (first shard SHA-256 03b11926...42fdc5 verified), freshly converted native pack, Strata at d5ea713, Linux, 2x identical RTX 4080 SUPER 32GB, driver 610.43.

20 cold 211,023-token requests across 5 arms, all completed with zero copy_i32 / qsa_prompt_attn_batch / mul_mat_q errors:

  • --prefill 16384 baseline and STRATA_PF_STEP_SYNC=1 (4+4)
  • --prefill auto:32768 — resolved to a full 32,768-token chunk on these cards — baseline and step-sync (4+4)
  • STRATA_PROMPT_ATTN_OLD=1 at 16384 (4)

Not reproduced. Given your earlier qsa_prompt_attn_batch/mul_mat_q errors and the PF_STEP_SYNC mitigation, this still looks like an asynchronous prefill race that our Linux/homogeneous-32GB/driver-610 combination does not trigger — a clean run here does not disprove the Windows dual-16GB report. If helpful, the next strongest signals would be a Windows-side compute-sanitizer/trap run or the stall dump the maintainer asked for.

<!-- gh-comment-id:6083489517 --> @Momoyeyu commented on GitHub (Oct 9, 2026): Exact-pack reproduction attempt on different hardware: reporter-confirmed `SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF` IQ3_XXS at rev `eec4e10` (first shard SHA-256 `03b11926...42fdc5` verified), freshly converted native pack, Strata at d5ea713, Linux, 2x identical RTX 4080 SUPER 32GB, driver 610.43. 20 cold 211,023-token requests across 5 arms, all completed with zero `copy_i32` / `qsa_prompt_attn_batch` / `mul_mat_q` errors: - `--prefill 16384` baseline and `STRATA_PF_STEP_SYNC=1` (4+4) - `--prefill auto:32768` — resolved to a full 32,768-token chunk on these cards — baseline and step-sync (4+4) - `STRATA_PROMPT_ATTN_OLD=1` at 16384 (4) Not reproduced. Given your earlier `qsa_prompt_attn_batch`/`mul_mat_q` errors and the `PF_STEP_SYNC` mitigation, this still looks like an asynchronous prefill race that our Linux/homogeneous-32GB/driver-610 combination does not trigger — a clean run here does not disprove the Windows dual-16GB report. If helpful, the next strongest signals would be a Windows-side `compute-sanitizer`/trap run or the stall dump the maintainer asked for.
Author
Owner

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

GGUF identity confirmed — exact match with the shards you pinned:

  • Qwen3.8-Flash-Next-GSQ-RCO-abliterated-IQ3_XXS-00001-of-00002.gguf
    • Size: 47,342,144,896 bytes
    • SHA-256: 03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5
  • Shard 2: 28,800,138,432 bytes (matches)

Same repo/revision you cited (SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF, IQ3_XXS).

Ablation controls (your requested matrix)

All on the same Windows host that produced the original reports, engine 0.1.41, --prefill auto:16384, STRATA_PF_STEP_SYNC and CUDA_LAUNCH_BLOCKING both unset. Each arm: 5 cold requests (cache_prompt=false), target 102400 tokens (actual prompt_tokens=96689 each), max_tokens=16, temperature=0.

Control Flags Requests Result Illegal delta
A no --vision, keep --trim-stage-weights 5/5 completed ~51s wall each 0
B keep --vision, drop --trim-stage-weights 5/5 completed ~53s wall each 0
C baseline (both flags) + STRATA_PROMPT_ATTN_OLD=1 5/5 completed ~71–85s wall each (old attn is slower, as expected) 0

Illegal-access counter was 53 before and 53 after all three arms.

Caveat: 5 requests per arm is a small sample for an intermittent fault. My historical base rate on this machine is roughly 1 illegal per 20–30 heavy long-context requests, sometimes clustered, sometimes quiet for hours. "No repro in 5" is therefore consistent with the bug still being present — it is not an exclusion. The same limitation applies to the earlier 4-request Linux control.

Correction: STRATA_PF_STEP_SYNC=1 is not a complete fix

I previously reported 3/3 clean large-prompt runs with STRATA_PF_STEP_SYNC=1. That was small-sample luck. After leaving the flag on as a default, the illegal counter went 51 → 53 (two independent events, minutes apart) on engines where the flag was confirmed active by the strata pf-step: log lines:

  • Event 1: strata pf-step: chunk from token 32768, layer 0: ... (no error / no error) immediately precedes prefill copy_i32: an illegal memory access was encountered
  • Event 2: same pattern after the automatic engine restart

So PF_STEP_SYNC reduces frequency in my experience but does not eliminate the fault. The pf-step syncs themselves reporting "no error" while the error surfaces at the next copy_i32 error check is itself consistent with your sticky-error framing: the reporting order tracks who does an error-checking API call after the async access, not who issued the faulting kernel.

Historical log evidence (older engine builds)

On engine 0.1.40.3 with --prefill auto:32768, the same failure event logged:

qsa_prompt_attn_batch: ...
prefill mmq: mul_mat_q: ...
prefill copy_i32: an illegal memory access was encountered

On 0.1.34-era builds, prefill mmq: mul_mat_q appeared before prefill copy_i32 in the same event. On 0.1.41 with auto:16384, only the copy_i32 line appears. This matches your observation that qsa/mmq lines read the same last-error state — the earlier lines fired when those kernels had explicit error checks that ran before copy_i32's check; in the current build copy_i32 is simply the first error-checking launch after the fault.

What would help next

Given the intermittency, the most useful next step on my side is probably a longer soak (50–100 cold large prompts per arm) to get the sample size above the base rate, or compute-sanitizer on your pinned Linux repro if you want me to try that here despite the earlier note to defer it. Alternatively, if you can point me at a specific suspect stream or event in the ring-buffer lifecycle (m.copy / m.kv_copy / give_back events), I can add targeted logging or a hardware watchpoint without touching the hot path. Happy to run whichever is most actionable for you.

<!-- gh-comment-id:6083780093 --> @btc1000w commented on GitHub (Oct 9, 2026): GGUF identity confirmed — exact match with the shards you pinned: - `Qwen3.8-Flash-Next-GSQ-RCO-abliterated-IQ3_XXS-00001-of-00002.gguf` - Size: 47,342,144,896 bytes - SHA-256: `03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5` - Shard 2: 28,800,138,432 bytes (matches) Same repo/revision you cited (`SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF`, IQ3_XXS). ## Ablation controls (your requested matrix) All on the same Windows host that produced the original reports, engine 0.1.41, `--prefill auto:16384`, `STRATA_PF_STEP_SYNC` and `CUDA_LAUNCH_BLOCKING` both unset. Each arm: 5 cold requests (`cache_prompt=false`), target 102400 tokens (actual `prompt_tokens=96689` each), `max_tokens=16`, `temperature=0`. | Control | Flags | Requests | Result | Illegal delta | |---|---|---|---|---| | A | no `--vision`, keep `--trim-stage-weights` | 5/5 completed | ~51s wall each | 0 | | B | keep `--vision`, drop `--trim-stage-weights` | 5/5 completed | ~53s wall each | 0 | | C | baseline (both flags) + `STRATA_PROMPT_ATTN_OLD=1` | 5/5 completed | ~71–85s wall each (old attn is slower, as expected) | 0 | Illegal-access counter was 53 before and 53 after all three arms. **Caveat:** 5 requests per arm is a small sample for an intermittent fault. My historical base rate on this machine is roughly 1 illegal per 20–30 heavy long-context requests, sometimes clustered, sometimes quiet for hours. "No repro in 5" is therefore consistent with the bug still being present — it is not an exclusion. The same limitation applies to the earlier 4-request Linux control. ## Correction: `STRATA_PF_STEP_SYNC=1` is not a complete fix I previously reported 3/3 clean large-prompt runs with `STRATA_PF_STEP_SYNC=1`. That was small-sample luck. After leaving the flag on as a default, the illegal counter went **51 → 53** (two independent events, minutes apart) on engines where the flag was confirmed active by the `strata pf-step:` log lines: - Event 1: `strata pf-step: chunk from token 32768, layer 0: ... (no error / no error)` immediately precedes `prefill copy_i32: an illegal memory access was encountered` - Event 2: same pattern after the automatic engine restart So PF_STEP_SYNC reduces frequency in my experience but does not eliminate the fault. The pf-step syncs themselves reporting "no error" while the error surfaces at the next `copy_i32` error check is itself consistent with your sticky-error framing: the reporting order tracks who does an error-checking API call after the async access, not who issued the faulting kernel. ## Historical log evidence (older engine builds) On engine 0.1.40.3 with `--prefill auto:32768`, the same failure event logged: ``` qsa_prompt_attn_batch: ... prefill mmq: mul_mat_q: ... prefill copy_i32: an illegal memory access was encountered ``` On 0.1.34-era builds, `prefill mmq: mul_mat_q` appeared before `prefill copy_i32` in the same event. On 0.1.41 with `auto:16384`, only the `copy_i32` line appears. This matches your observation that qsa/mmq lines read the same last-error state — the earlier lines fired when those kernels had explicit error checks that ran before copy_i32's check; in the current build copy_i32 is simply the first error-checking launch after the fault. ## What would help next Given the intermittency, the most useful next step on my side is probably a longer soak (50–100 cold large prompts per arm) to get the sample size above the base rate, or compute-sanitizer on your pinned Linux repro if you want me to try that here despite the earlier note to defer it. Alternatively, if you can point me at a specific suspect stream or event in the ring-buffer lifecycle (m.copy / m.kv_copy / give_back events), I can add targeted logging or a hardware watchpoint without touching the hot path. Happy to run whichever is most actionable for you.
Author
Owner

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

Your PF_STEP_SYNC correction is consistent with the code: the diagnostic only waits on two streams. From src/prefill/prefill.cpp (unchanged in 0.1.41):

const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy);

m.cs is the compute stream and m.copy the expert-ring copy stream. In your exact configuration (--layer-split 26, --kv-resident 32768 under a 262144 context) the prompt path also runs work on streams this check never waits on:

  • m.kv_copy — the KV staging-upload stream (kv_stage_from_host prefetches the [0, p0) prefix through it),
  • the stage-helper peer streams s / s_out / s_cp, created on the other GPU by set_stage_helper — used to stream this stage's expert share via the mapped-host route,
  • copies issued by the expert-ring issue thread (these are on m.copy, but ordered from a second host thread).

So pf-step reporting "no error / no error" only bounds cs+copy, and copy_i32 being the first reporter is still compatible with the fault living in KV upload or the cross-device helper path — the two places your config exercises that a single-GPU or unsplit run does not.

To discriminate, here is a one-hunk patch adding STRATA_PF_STEP_SYNC=2: same checkpoint, but cudaDeviceSynchronize() on every CUDA device, which covers all streams on both GPUs (it applies verbatim to 0.1.41 — the hunk is unchanged since 0.1.40.3 — and compiles cleanly on our side):

-        static const bool step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] == '1'; }();
+        static const int step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] >= '1' && e[0] <= '2' ? e[0] - '0' : 0; }();
         auto pf_step = [&](const char* what, int64_t layer) {
             if (!step_sync) return;
             core::progress_at(what, layer, p0);
             const auto ts = Clock::now();
-            const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy);
+            cudaError_t a = cudaSuccess, b = cudaSuccess;
+            if (step_sync == 2) {
+                // whole-device sync on every GPU: covers the KV-upload, expert-ring and peer/stage-helper
+                // streams the two-stream check cannot see.  Slower still; diagnosis only.
+                int prev_dev = 0, ndev = 0;
+                cudaGetDevice(&prev_dev);
+                cudaGetDeviceCount(&ndev);
+                for (int d = 0; d < ndev; ++d) {
+                    cudaSetDevice(d);
+                    const cudaError_t e = cudaDeviceSynchronize();
+                    if (e != cudaSuccess && a == cudaSuccess) a = e;
+                }
+                cudaSetDevice(prev_dev);
+            } else {
+                a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy);
+            }
             const double ms = ms_since(ts);

Reading the result:

  • If a strata pf-step: line now reports an error at a step boundary, the fault is bounded to that step's kernels — that names the suspect set precisely (e.g. the layer-1 PLE block, the qsa_prompt_attn_batch window, or the KV/handoff copies between layer steps).
  • If device-wide syncs still report clean while copy_i32 keeps firing, the error is escaping every device stream — that would point to WDDM deferred reporting or a fault issued outside these streams, and compute-sanitizer becomes the right next tool despite the slowdown.
  • And agreed on statistics: your 5-request arms and my 20 requests are both below your ~1/20–30 base rate, so neither side has excluded anything yet.
<!-- gh-comment-id:6084191816 --> @Momoyeyu commented on GitHub (Oct 9, 2026): Your PF_STEP_SYNC correction is consistent with the code: the diagnostic only waits on two streams. From src/prefill/prefill.cpp (unchanged in 0.1.41): ```cpp const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy); ``` `m.cs` is the compute stream and `m.copy` the expert-ring copy stream. In your exact configuration (`--layer-split 26`, `--kv-resident 32768` under a 262144 context) the prompt path also runs work on streams this check never waits on: - `m.kv_copy` — the KV staging-upload stream (`kv_stage_from_host` prefetches the [0, p0) prefix through it), - the stage-helper peer streams `s` / `s_out` / `s_cp`, created on the *other* GPU by `set_stage_helper` — used to stream this stage's expert share via the mapped-host route, - copies issued by the expert-ring issue thread (these are on `m.copy`, but ordered from a second host thread). So `pf-step` reporting "no error / no error" only bounds cs+copy, and `copy_i32` being the first reporter is still compatible with the fault living in KV upload or the cross-device helper path — the two places your config exercises that a single-GPU or unsplit run does not. To discriminate, here is a one-hunk patch adding `STRATA_PF_STEP_SYNC=2`: same checkpoint, but `cudaDeviceSynchronize()` on **every** CUDA device, which covers all streams on both GPUs (it applies verbatim to 0.1.41 — the hunk is unchanged since 0.1.40.3 — and compiles cleanly on our side): ```diff - static const bool step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] == '1'; }(); + static const int step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] >= '1' && e[0] <= '2' ? e[0] - '0' : 0; }(); auto pf_step = [&](const char* what, int64_t layer) { if (!step_sync) return; core::progress_at(what, layer, p0); const auto ts = Clock::now(); - const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy); + cudaError_t a = cudaSuccess, b = cudaSuccess; + if (step_sync == 2) { + // whole-device sync on every GPU: covers the KV-upload, expert-ring and peer/stage-helper + // streams the two-stream check cannot see. Slower still; diagnosis only. + int prev_dev = 0, ndev = 0; + cudaGetDevice(&prev_dev); + cudaGetDeviceCount(&ndev); + for (int d = 0; d < ndev; ++d) { + cudaSetDevice(d); + const cudaError_t e = cudaDeviceSynchronize(); + if (e != cudaSuccess && a == cudaSuccess) a = e; + } + cudaSetDevice(prev_dev); + } else { + a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy); + } const double ms = ms_since(ts); ``` Reading the result: - If a `strata pf-step:` line now reports an error *at a step boundary*, the fault is bounded to that step's kernels — that names the suspect set precisely (e.g. the layer-1 PLE block, the `qsa_prompt_attn_batch` window, or the KV/handoff copies between layer steps). - If device-wide syncs still report clean while `copy_i32` keeps firing, the error is escaping every device stream — that would point to WDDM deferred reporting or a fault issued outside these streams, and compute-sanitizer becomes the right next tool despite the slowdown. - And agreed on statistics: your 5-request arms and my 20 requests are both below your ~1/20–30 base rate, so neither side has excluded anything yet.
Author
Owner

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

A different trigger on gfx1030: 1 fault in 12 long prompts with a small --prefill 512

We hit this error class on an AMD Radeon Pro V620 (gfx1030, RDNA2) with engine 0.1.40.3, but our chunk
size is nowhere near auto:32768, so I would like to check whether the chunk size is the only trigger.

What we see. 1 run in 12 of a synthetic ~12,000-token prompt returned:

400 invalid request: prefill: the draft layer's K/V: an illegal memory access was encountered

and the kernel logged a GPU page fault for that pid:

[gfxhub] page fault (src_id:0 ring:24 vmid:8 pasid:32772, for process strata pid 239152 thread strata pid 239152)
  in page starting at address 0x00007c400ee53000 from client 0x1b (UTCL2)
GCVM_L2_PROTECTION_FAULT_STATUS:0x00801031
         Faulty UTCL2 client ID: TCP (0x8)
         MORE_FAULTS: 0x1
         WALKER_ERROR: 0x0
         PERMISSION_FAULTS: 0x3
         MAPPING_ERROR: 0x0
         RW: 0x0

Note the status: PERMISSION_FAULTS 0x3 with MAPPING_ERROR 0x0 — the page is mapped, but not with the
permission the access needed. Your note that copy_i32 is "the first kernel launched after a stream
synchronisation" and reports the sticky error would explain why our report names a different kernel
(the draft layer's K/V) while the driver signature looks like the same fault class.

Our setup, with the differences from yours that might matter:

  • --prefill 512 (fixed, not auto:32768) — chunks of ~512 tokens, so a 12k prompt is ~24 of them
  • --spec 4 --spec-min-p 0.5 --mtp <rt> — the MTP draft layer is active, and that is where our error
    surfaces
  • --expert-cache auto → 13,021 of the model's 24,576 expert slots (26.39 GiB), --kv int8,
    --max-context 32768
  • model: Qwen3.8-Flash-Next-Uncensored IQ3_XXS, native pack, 49.8 GiB expert arena, one card
  • ROCm 7.2.4 (system /opt/rocm), Ubuntu 24.04, kernel 6.8.0-142, 160 GB host RAM, engine built from
    source (-DSTRATA_ENABLE_HIP=ON -DSTRATA_PREFILL_MMQ=ON -DCMAKE_HIP_ARCHITECTURES=gfx1030)

Correction to something I wrote in an earlier draft of this comment: I first said the engine "keeps
serving" through this fault. It does not. The wrapper logs the engine had stopped (exit code 1); starting it again, so the fault takes the engine down and the next request pays a warm reload (~65 s
here, against ~2.5 min for a cold one) — note exit code 1, not the watchdog's -6. What the client
gets is a clean 400 naming the fault rather than a hang. That distinction is the whole difference from
the 0.1.38 failure mode below, and it is worth being precise about.

We tested your workaround's variable here, and it does not explain our case. With the same
~12,000-token prompts, temperature 0, each run's body randomised so reused stays 0:

--prefill chunks per prompt runs faults steady prefill
512 ~24 24 + 12 0 (plus 1 in a separate 12-run batch) ~280-285 tok/s
auto:16384 1 (the engine logs prompt chunk auto: 16384 tokens, a 384-slot ring) 24 0 ~334 tok/s

So on this box the fault is rare at both ends of the chunk range — our whole observed rate at --prefill 512 is 1 failure in 36 runs — and the chunk size does not drive it the way it does in your report. Two
other differences from your setup that I would look at before the chunk size: our chunk is a fixed 512
rather than the auto-sized ~20,480 that crashed for you, and our error names the draft layer's K/V
while yours names copy_i32
, which per your note may be the sticky error surfacing in whichever kernel
runs first.

A separate finding, if it is useful: auto:16384 is ~18% faster at prompt read than --prefill 512 on this box (334 against 282 tok/s, measured in both orders — 24 runs one way, 24 + 12 the other, so
it is not warm-up). That matches 0.1.39's note that auto picks the largest chunk that keeps the ring
full. It cost nothing in faults. No request: just a data point that a fixed small chunk has a price.

<!-- gh-comment-id:6088988510 --> @jhardin1 commented on GitHub (Oct 9, 2026): **A different trigger on gfx1030: 1 fault in 12 long prompts with a small `--prefill 512`** We hit this error class on an AMD Radeon Pro V620 (gfx1030, RDNA2) with engine 0.1.40.3, but our chunk size is nowhere near `auto:32768`, so I would like to check whether the chunk size is the only trigger. **What we see.** 1 run in 12 of a synthetic ~12,000-token prompt returned: ``` 400 invalid request: prefill: the draft layer's K/V: an illegal memory access was encountered ``` and the kernel logged a GPU page fault for that pid: ``` [gfxhub] page fault (src_id:0 ring:24 vmid:8 pasid:32772, for process strata pid 239152 thread strata pid 239152) in page starting at address 0x00007c400ee53000 from client 0x1b (UTCL2) GCVM_L2_PROTECTION_FAULT_STATUS:0x00801031 Faulty UTCL2 client ID: TCP (0x8) MORE_FAULTS: 0x1 WALKER_ERROR: 0x0 PERMISSION_FAULTS: 0x3 MAPPING_ERROR: 0x0 RW: 0x0 ``` Note the status: `PERMISSION_FAULTS 0x3` with `MAPPING_ERROR 0x0` — the page is mapped, but not with the permission the access needed. Your note that `copy_i32` is "the first kernel launched after a stream synchronisation" and reports the *sticky* error would explain why our report names a different kernel (the draft layer's K/V) while the driver signature looks like the same fault class. **Our setup**, with the differences from yours that might matter: - **`--prefill 512`** (fixed, *not* `auto:32768`) — chunks of ~512 tokens, so a 12k prompt is ~24 of them - `--spec 4 --spec-min-p 0.5 --mtp <rt>` — the MTP draft layer is active, and that is where our error surfaces - `--expert-cache auto` → 13,021 of the model's 24,576 expert slots (26.39 GiB), `--kv int8`, `--max-context 32768` - model: Qwen3.8-Flash-Next-Uncensored IQ3_XXS, native pack, 49.8 GiB expert arena, one card - ROCm 7.2.4 (system `/opt/rocm`), Ubuntu 24.04, kernel 6.8.0-142, 160 GB host RAM, engine built from source (`-DSTRATA_ENABLE_HIP=ON -DSTRATA_PREFILL_MMQ=ON -DCMAKE_HIP_ARCHITECTURES=gfx1030`) **Correction to something I wrote in an earlier draft of this comment:** I first said the engine "keeps serving" through this fault. It does not. The wrapper logs `the engine had stopped (exit code 1); starting it again`, so the fault takes the engine down and the next request pays a warm reload (~65 s here, against ~2.5 min for a cold one) — note `exit code 1`, not the watchdog's `-6`. What the client gets is a clean `400` naming the fault rather than a hang. That distinction is the whole difference from the 0.1.38 failure mode below, and it is worth being precise about. **We tested your workaround's variable here, and it does not explain our case.** With the same ~12,000-token prompts, `temperature 0`, each run's body randomised so `reused` stays 0: | `--prefill` | chunks per prompt | runs | faults | steady prefill | | --- | --- | --- | --- | --- | | `512` | ~24 | 24 + 12 | **0** (plus 1 in a separate 12-run batch) | ~280-285 tok/s | | `auto:16384` | 1 (the engine logs `prompt chunk auto: 16384 tokens, a 384-slot ring`) | 24 | **0** | ~334 tok/s | So on this box the fault is rare at both ends of the chunk range — our whole observed rate at `--prefill 512` is 1 failure in 36 runs — and the chunk size does not drive it the way it does in your report. Two other differences from your setup that I would look at before the chunk size: our chunk is a *fixed* 512 rather than the auto-sized ~20,480 that crashed for you, and **our error names the draft layer's K/V while yours names `copy_i32`**, which per your note may be the sticky error surfacing in whichever kernel runs first. **A separate finding, if it is useful:** `auto:16384` is **~18% faster at prompt read** than `--prefill 512` on this box (334 against 282 tok/s, measured in both orders — 24 runs one way, 24 + 12 the other, so it is not warm-up). That matches 0.1.39's note that `auto` picks the largest chunk that keeps the ring full. It cost nothing in faults. No request: just a data point that a fixed small chunk has a price.
Author
Owner

@btc1000w commented on GitHub (Oct 10, 2026):

Results from a Windows dual-16 GB box (RTX 3080 Laptop + RTX 3070 Laptop, driver 616.56, engine built from source at 0.1.40.3; config: --layer-split 26, --kv-resident 32768, --max-context 262144, --prefill auto:16384, --mtp rt, --spec 4 --spec-min-p 0.70, --pipeline-windows 2, --vision, --trim-stage-weights).

1. STRATA_PF_STEP_SYNC=2 (your one-hunk patch)

Applied verbatim; compiles clean on 0.1.40.3. 40 cold ~97k-token prompts, one at a time, cache_prompt=false:

  • runs: 40
  • faults: 0 (the log's illegal-access count stays at its baseline of 53)
  • pf-step lines printed: 6, every one a ">250 ms" slow step, all "no error / no error" (e.g. chunk from token 65536, layer 15 ... took 293 ms (no error / no error))

So a whole-device sync at every step boundary did not catch a fault in 40 runs. That is either =2 closing the race window, or 40 runs still sitting inside the ~1/20-30 base rate (P(0 in 40 | 1/20) ≈ 13%, | 1/30 ≈ 26%). Not conclusive on its own, but it is directional: =1 (cs+copy only) let the fault through at 51→53 earlier, =2 (all devices) kept 40 runs clean.

2. --prefill 512 cross-check (jhardin1's chunk shape)

To test whether the reporter kernel follows the chunk size, I ran that shape here: --prefill 512 (fixed) with ~12k-token cold prompts, temperature 0, body randomised so reused stays 0, 36 runs.

  • 36/36 clean, 0 faults, and specifically no "draft layer's K/V" reporter — only silence.
  • Timing confirms 512 took effect (≈330 tok/s against ≈1700 tok/s at auto:16384), so the flag is not being ignored.

On this box the small-chunk shape is simply rarer, which lines up with the 1-in-36 you measured at 512.

3. compute-sanitizer feasibility (measured, not assumed)

I wrapped the engine in compute-sanitizer memcheck (same config, --vram-reserve-mib raised to 2048 to leave room for shadow memory). The measured overhead is ≈230x: a 27,755-token prefill ran 3,773,000 ms (63 min) and was cancelled at 27,748/27,755 tokens, at 7.4 tok/s against the ≈1700 tok/s this config normally does. At a 1/20-36 fault rate, catching one fault under memcheck needs roughly 20-40 runs × >1 h each, so the sanitizer route is not practical on this workload.

Side note (probably not #1468): after the cancelled memcheck request the engine went unresponsive — /status and /health time out while both GPUs sit idle — which looks like memcheck + cancellation hygiene rather than the fault itself.

4. What the two vendors' data say together

  • Same fault class on CUDA and on ROCm → engine-level race, not a driver quirk.
  • Different reporter kernels (copy_i32 here, draft layer's K/V for jhardin1) fit the sticky-error story: whichever kernel first reaches a sync after the fault names it.
  • jhardin1's GCVM_L2 signature is the sharpest clue so far: PERMISSION_FAULTS=0x3 with MAPPING_ERROR=0x0 — the page is mapped but not with the permission the access needed. That is the fingerprint of a buffer being repurposed or re-protected while a still-in-flight access holds it.
  • The one thing both crashing shapes share is a multi-chunk prefill with the MTP draft layer active.

5. A cheaper next probe than sanitizer

Rather than device-wide sync, a per-stream variant would name the culprit directly: at each pf_step, sync m.kv_copy and the stage-helper peer streams (s / s_out / s_cp) individually and report which one returns the error, alongside the existing cs/copy check. Same patch shape as =2 but reports per stream, so a fault pins one stream instead of only telling us "not cs or copy". If that still reports clean while copy_i32 fires, the fault is genuinely outside every engine stream and we are into WDDM deferred reporting — at which point the only remaining tool is sanitizer, which we have now measured as impractical here.

Happy to run the per-stream variant if you want to point me at it.

<!-- gh-comment-id:6092260965 --> @btc1000w commented on GitHub (Oct 10, 2026): Results from a Windows dual-16 GB box (RTX 3080 Laptop + RTX 3070 Laptop, driver 616.56, engine built from source at 0.1.40.3; config: --layer-split 26, --kv-resident 32768, --max-context 262144, --prefill auto:16384, --mtp rt, --spec 4 --spec-min-p 0.70, --pipeline-windows 2, --vision, --trim-stage-weights). **1. STRATA_PF_STEP_SYNC=2 (your one-hunk patch)** Applied verbatim; compiles clean on 0.1.40.3. 40 cold ~97k-token prompts, one at a time, cache_prompt=false: - runs: 40 - faults: 0 (the log's illegal-access count stays at its baseline of 53) - pf-step lines printed: 6, every one a ">250 ms" slow step, all "no error / no error" (e.g. `chunk from token 65536, layer 15 ... took 293 ms (no error / no error)`) So a whole-device sync at every step boundary did not catch a fault in 40 runs. That is either =2 closing the race window, or 40 runs still sitting inside the ~1/20-30 base rate (P(0 in 40 | 1/20) ≈ 13%, | 1/30 ≈ 26%). Not conclusive on its own, but it is directional: =1 (cs+copy only) let the fault through at 51→53 earlier, =2 (all devices) kept 40 runs clean. **2. --prefill 512 cross-check (jhardin1's chunk shape)** To test whether the reporter kernel follows the chunk size, I ran that shape here: --prefill 512 (fixed) with ~12k-token cold prompts, temperature 0, body randomised so reused stays 0, 36 runs. - 36/36 clean, 0 faults, and specifically no "draft layer's K/V" reporter — only silence. - Timing confirms 512 took effect (≈330 tok/s against ≈1700 tok/s at auto:16384), so the flag is not being ignored. On this box the small-chunk shape is simply rarer, which lines up with the 1-in-36 you measured at 512. **3. compute-sanitizer feasibility (measured, not assumed)** I wrapped the engine in compute-sanitizer memcheck (same config, --vram-reserve-mib raised to 2048 to leave room for shadow memory). The measured overhead is ≈230x: a 27,755-token prefill ran 3,773,000 ms (63 min) and was cancelled at 27,748/27,755 tokens, at 7.4 tok/s against the ≈1700 tok/s this config normally does. At a 1/20-36 fault rate, catching one fault under memcheck needs roughly 20-40 runs × >1 h each, so the sanitizer route is not practical on this workload. Side note (probably not #1468): after the cancelled memcheck request the engine went unresponsive — /status and /health time out while both GPUs sit idle — which looks like memcheck + cancellation hygiene rather than the fault itself. **4. What the two vendors' data say together** - Same fault class on CUDA and on ROCm → engine-level race, not a driver quirk. - Different reporter kernels (copy_i32 here, draft layer's K/V for jhardin1) fit the sticky-error story: whichever kernel first reaches a sync after the fault names it. - jhardin1's GCVM_L2 signature is the sharpest clue so far: PERMISSION_FAULTS=0x3 with MAPPING_ERROR=0x0 — the page is mapped but not with the permission the access needed. That is the fingerprint of a buffer being repurposed or re-protected while a still-in-flight access holds it. - The one thing both crashing shapes share is a multi-chunk prefill with the MTP draft layer active. **5. A cheaper next probe than sanitizer** Rather than device-wide sync, a per-stream variant would name the culprit directly: at each pf_step, sync m.kv_copy and the stage-helper peer streams (s / s_out / s_cp) individually and report which one returns the error, alongside the existing cs/copy check. Same patch shape as =2 but reports per stream, so a fault pins one stream instead of only telling us "not cs or copy". If that still reports clean while copy_i32 fires, the fault is genuinely outside every engine stream and we are into WDDM deferred reporting — at which point the only remaining tool is sanitizer, which we have now measured as impractical here. Happy to run the per-stream variant if you want to point me at it.
Author
Owner

@btc1000w commented on GitHub (Oct 10, 2026):

Update after the STRATA_PF_STEP_SYNC=2 results above.

I switched back to engine 0.1.41 (the release build) and kept the smaller chunk. Everything else is as before: --layer-split 26, --kv-resident 32768, --max-context 262144, --mtp rt, --spec 4 --spec-min-p 0.70, --pipeline-windows 2, --suffix-draft 3, --mtp-hnorm stream, --vision, --trim-stage-weights.

Stability runs — one request at a time, cache_prompt=false, temperature 0, randomised bodies:

  • 0.1.41 + auto:16384, 15 × ~98k-token cold prompts: 15/15 OK, no illegal access (the log's count stays at its baseline), no hang, ~51-52 s each.
  • 0.1.40.3 + auto:16384, 43 more long prompts spanning 61k-262k tokens: all clean, no hang at any size.

Filling the context, on 0.1.41 + auto:16384 (--max-context 262144):

  • ~250k-token prompts (249,867 actual): 3/3 OK, ~126 s each.
  • ~262k-token prompts (261,021 actual, ~1k below the limit): 3/3 OK, ~133 s each.
  • Over the limit (~272k and ~286k actual): rejected cleanly with HTTP 400 in ~4 s — a rejection, not a hang.

So on this box the auto:16384 path is clean on both 0.1.40.3 and 0.1.41, and exhausting or exceeding the context does not hang — the engine either completes or returns a clean 400. The fault I originally reported stays tied to the larger chunk (auto:32768). The =2 result above is still the strongest clue I have on where it lives.

I will keep running the stable config and report back if anything changes.

<!-- gh-comment-id:6093897330 --> @btc1000w commented on GitHub (Oct 10, 2026): Update after the STRATA_PF_STEP_SYNC=2 results above. I switched back to engine 0.1.41 (the release build) and kept the smaller chunk. Everything else is as before: --layer-split 26, --kv-resident 32768, --max-context 262144, --mtp rt, --spec 4 --spec-min-p 0.70, --pipeline-windows 2, --suffix-draft 3, --mtp-hnorm stream, --vision, --trim-stage-weights. Stability runs — one request at a time, cache_prompt=false, temperature 0, randomised bodies: - 0.1.41 + auto:16384, 15 × ~98k-token cold prompts: 15/15 OK, no illegal access (the log's count stays at its baseline), no hang, ~51-52 s each. - 0.1.40.3 + auto:16384, 43 more long prompts spanning 61k-262k tokens: all clean, no hang at any size. Filling the context, on 0.1.41 + auto:16384 (--max-context 262144): - ~250k-token prompts (249,867 actual): 3/3 OK, ~126 s each. - ~262k-token prompts (261,021 actual, ~1k below the limit): 3/3 OK, ~133 s each. - Over the limit (~272k and ~286k actual): rejected cleanly with HTTP 400 in ~4 s — a rejection, not a hang. So on this box the auto:16384 path is clean on both 0.1.40.3 and 0.1.41, and exhausting or exceeding the context does not hang — the engine either completes or returns a clean 400. The fault I originally reported stays tied to the larger chunk (auto:32768). The =2 result above is still the strongest clue I have on where it lives. I will keep running the stable config and report back if anything changes.
Author
Owner

@Momoyeyu commented on GitHub (Oct 10, 2026):

Here is the per-stream variant — STRATA_PF_STEP_SYNC=3, same patch site (the hunk still applies verbatim on 0.1.40.3/0.1.41 and compiles):

-        static const bool step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] == '1'; }();
+        static const int step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] >= '1' && e[0] <= '3' ? e[0] - '0' : 0; }();
         auto pf_step = [&](const char* what, int64_t layer) {
             if (!step_sync) return;
             core::progress_at(what, layer, p0);
             const auto ts = Clock::now();
-            const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy);
+            cudaError_t a = cudaSuccess, b = cudaSuccess;
+            if (step_sync == 2) {
+                // whole-device sync on every GPU: covers the KV-upload, expert-ring and peer/stage-helper
+                // streams the two-stream check cannot see.  Slower still; diagnosis only.
+                int prev_dev = 0, ndev = 0;
+                cudaGetDevice(&prev_dev);
+                cudaGetDeviceCount(&ndev);
+                for (int d = 0; d < ndev; ++d) {
+                    cudaSetDevice(d);
+                    const cudaError_t e = cudaDeviceSynchronize();
+                    if (e != cudaSuccess && a == cudaSuccess) a = e;
+                }
+                cudaSetDevice(prev_dev);
+            } else if (step_sync == 3) {
+                // per-stream: wait each stream doing prompt work and name it.  A sticky fault is
+                // reported by every sync after it lands, so the FIRST failing name is the lead -
+                // strongest when the stream's own queued work faults while this wait is on it.
+                struct StreamSync { const char* name; cudaError_t e; };
+                const auto wait = [](cudaStream_t s) { return s ? cudaStreamSynchronize(s) : cudaSuccess; };
+                const PeerPrefill* hp = m.help_pp.get();
+                const PeerPrefill* pp2 = m.pp.get();
+                const cudaError_t pre = cudaPeekAtLastError();   // a sticky fault already pending before any wait
+                StreamSync rs[] = {{"cs", wait(m.cs)}, {"copy", wait(m.copy)}, {"kv_copy", wait(m.kv_copy)},
+                                   {"help.s", hp ? wait(hp->s) : cudaSuccess},
+                                   {"help.s_out", hp ? wait(hp->s_out) : cudaSuccess},
+                                   {"help.s_cp", hp ? wait(hp->s_cp) : cudaSuccess},
+                                   {"peer.s", pp2 ? wait(pp2->s) : cudaSuccess},
+                                   {"peer.s_out", pp2 ? wait(pp2->s_out) : cudaSuccess},
+                                   {"peer.s_cp", pp2 ? wait(pp2->s_cp) : cudaSuccess}};
+                const double ms = ms_since(ts);
+                bool bad = ms > 250.0;
+                for (const StreamSync& r : rs) bad = bad || r.e != cudaSuccess;
+                if (bad || pre != cudaSuccess) {
+                    std::fprintf(stderr, "strata pf-step: chunk from token %lld, layer %lld: %s took %.0f ms pre=%s",
+                                 (long long) p0, (long long) layer, what, ms, cudaGetErrorString(pre));
+                    for (const StreamSync& r : rs) std::fprintf(stderr, " %s=%s", r.name, cudaGetErrorString(r.e));
+                    std::fprintf(stderr, "\n");
+                }
+                return;
+            } else {
+                a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy);
+            }
             const double ms = ms_since(ts);

This supersedes the =2 hunk — one env var selects 1 (cs+copy), 2 (all devices) or 3 (named per-stream). Two reading aids built in:

  • pre= is cudaPeekAtLastError() taken before any wait. If pre is already an error at a boundary, the fault predates this step's syncs and the names that follow are all just inheriting the sticky state — the informative boundary is the earlier one where pre flips.
  • If pre=no error and one named stream returns the error first, that stream's queued work faulted during its wait — that is the attribution we want (kv_copy vs help.* on the second GPU vs cs/copy). Caveat you already know: once the sticky flag lands, every later sync reports it, so read the first failing name as the lead, not proof.

Your =2 result narrows things either way: if =3 catches a fault with pre=no error and a named stream, we have the suspect set; if everything stays clean again, the odds that =2 merely got lucky shrink. And thanks for the measured sanitizer number — 230x at a 1/20-36 rate is conclusively impractical, agreed. The jhardin1 GCVM_L2 permission-fault signature is indeed the sharpest clue: mapped-but-wrong-permission reads like a buffer handed back to a pool while a reader is still in flight — the give-back/ring lifecycle you offered to instrument. If the per-stream probe names kv_copy or a help.* stream, that is exactly the lifecycle I would instrument next.

<!-- gh-comment-id:6095759690 --> @Momoyeyu commented on GitHub (Oct 10, 2026): Here is the per-stream variant — `STRATA_PF_STEP_SYNC=3`, same patch site (the hunk still applies verbatim on 0.1.40.3/0.1.41 and compiles): ```diff - static const bool step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] == '1'; }(); + static const int step_sync = [] { const char* e = std::getenv("STRATA_PF_STEP_SYNC"); return e && e[0] >= '1' && e[0] <= '3' ? e[0] - '0' : 0; }(); auto pf_step = [&](const char* what, int64_t layer) { if (!step_sync) return; core::progress_at(what, layer, p0); const auto ts = Clock::now(); - const cudaError_t a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy); + cudaError_t a = cudaSuccess, b = cudaSuccess; + if (step_sync == 2) { + // whole-device sync on every GPU: covers the KV-upload, expert-ring and peer/stage-helper + // streams the two-stream check cannot see. Slower still; diagnosis only. + int prev_dev = 0, ndev = 0; + cudaGetDevice(&prev_dev); + cudaGetDeviceCount(&ndev); + for (int d = 0; d < ndev; ++d) { + cudaSetDevice(d); + const cudaError_t e = cudaDeviceSynchronize(); + if (e != cudaSuccess && a == cudaSuccess) a = e; + } + cudaSetDevice(prev_dev); + } else if (step_sync == 3) { + // per-stream: wait each stream doing prompt work and name it. A sticky fault is + // reported by every sync after it lands, so the FIRST failing name is the lead - + // strongest when the stream's own queued work faults while this wait is on it. + struct StreamSync { const char* name; cudaError_t e; }; + const auto wait = [](cudaStream_t s) { return s ? cudaStreamSynchronize(s) : cudaSuccess; }; + const PeerPrefill* hp = m.help_pp.get(); + const PeerPrefill* pp2 = m.pp.get(); + const cudaError_t pre = cudaPeekAtLastError(); // a sticky fault already pending before any wait + StreamSync rs[] = {{"cs", wait(m.cs)}, {"copy", wait(m.copy)}, {"kv_copy", wait(m.kv_copy)}, + {"help.s", hp ? wait(hp->s) : cudaSuccess}, + {"help.s_out", hp ? wait(hp->s_out) : cudaSuccess}, + {"help.s_cp", hp ? wait(hp->s_cp) : cudaSuccess}, + {"peer.s", pp2 ? wait(pp2->s) : cudaSuccess}, + {"peer.s_out", pp2 ? wait(pp2->s_out) : cudaSuccess}, + {"peer.s_cp", pp2 ? wait(pp2->s_cp) : cudaSuccess}}; + const double ms = ms_since(ts); + bool bad = ms > 250.0; + for (const StreamSync& r : rs) bad = bad || r.e != cudaSuccess; + if (bad || pre != cudaSuccess) { + std::fprintf(stderr, "strata pf-step: chunk from token %lld, layer %lld: %s took %.0f ms pre=%s", + (long long) p0, (long long) layer, what, ms, cudaGetErrorString(pre)); + for (const StreamSync& r : rs) std::fprintf(stderr, " %s=%s", r.name, cudaGetErrorString(r.e)); + std::fprintf(stderr, "\n"); + } + return; + } else { + a = cudaStreamSynchronize(m.cs), b = cudaStreamSynchronize(m.copy); + } const double ms = ms_since(ts); ``` This supersedes the =2 hunk — one env var selects 1 (cs+copy), 2 (all devices) or 3 (named per-stream). Two reading aids built in: - `pre=` is `cudaPeekAtLastError()` taken *before* any wait. If `pre` is already an error at a boundary, the fault predates this step's syncs and the names that follow are all just inheriting the sticky state — the informative boundary is the earlier one where `pre` flips. - If `pre=no error` and one named stream returns the error first, that stream's queued work faulted during its wait — that is the attribution we want (`kv_copy` vs `help.*` on the second GPU vs `cs`/`copy`). Caveat you already know: once the sticky flag lands, every later sync reports it, so read the first failing name as the lead, not proof. Your =2 result narrows things either way: if =3 catches a fault with `pre=no error` and a named stream, we have the suspect set; if everything stays clean again, the odds that =2 merely got lucky shrink. And thanks for the measured sanitizer number — 230x at a 1/20-36 rate is conclusively impractical, agreed. The jhardin1 GCVM_L2 permission-fault signature is indeed the sharpest clue: mapped-but-wrong-permission reads like a buffer handed back to a pool while a reader is still in flight — the give-back/ring lifecycle you offered to instrument. If the per-stream probe names `kv_copy` or a `help.*` stream, that is exactly the lifecycle I would instrument next.
Author
Owner

@btc1000w commented on GitHub (Oct 10, 2026):

Correction and a hang capture, same Windows dual-16 GB box (RTX 3080 Laptop + RTX 3070 Laptop, engine 0.1.41; config: --prefill auto:16384 --layer-split 26 --kv-resident 32768 --max-context 262144 --mtp rt --spec 4 --spec-min-p 0.70 --pipeline-windows 2 --suffix-draft 3 --mtp-hnorm stream --vision --trim-stage-weights).

1. Correction to my previous update

My "auto:16384 is clean" result was measured with synthetic cold prompts (cache_prompt=false). It does not hold for real chat. Serving a normal conversation (prefix-cache reuse, context growing to ~90k) the fault reproduced three times in one session; the log's illegal-access count went 53 -> 58. The request that faulted:

strata serve: prompt 89814 tokens = 83414 reused + 6400 read in 8579 ms (746.0 tok/s), 101 generated in 1207 ms (83.7 tok/s), drafts accepted 69 of 83, 6 checkpoints
prefill copy_i32: an illegal memory access was encountered

So the trigger is not "cold long prompt with a large chunk" alone: every cold synthetic run here (61k-262k, 58 requests) stayed clean, while the reused-prefix chat path faulted. Long context and/or the prefix-reuse path look like the more likely common factor, and I over-claimed in the previous update.

2. The fault hangs the engine here (spin, not a clean error)

Unlike jhardin1's box (clean HTTP 400, engine exits), here the engine spins: the process keeps burning CPU (~5 threads pinned, ~30 s of CPU per 6 s wall) while both GPUs sit at 0%, and /status stays "reading the prompt" for 40+ minutes with no recovery. It has to be killed by hand.

3. Attached

strata_hang_8680.dmp - a mini dump of the hung process, taken while it was spinning (thread stacks + module list). No debugger was installed on this box, so I could not read the stacks myself. The spinning threads are 5, all in state Running, with both GPUs idle at capture time.

strata_hang_8680.dmp

<!-- gh-comment-id:6095819564 --> @btc1000w commented on GitHub (Oct 10, 2026): Correction and a hang capture, same Windows dual-16 GB box (RTX 3080 Laptop + RTX 3070 Laptop, engine 0.1.41; config: --prefill auto:16384 --layer-split 26 --kv-resident 32768 --max-context 262144 --mtp rt --spec 4 --spec-min-p 0.70 --pipeline-windows 2 --suffix-draft 3 --mtp-hnorm stream --vision --trim-stage-weights). **1. Correction to my previous update** My "auto:16384 is clean" result was measured with synthetic cold prompts (cache_prompt=false). It does not hold for real chat. Serving a normal conversation (prefix-cache reuse, context growing to ~90k) the fault reproduced three times in one session; the log's illegal-access count went 53 -> 58. The request that faulted: ``` strata serve: prompt 89814 tokens = 83414 reused + 6400 read in 8579 ms (746.0 tok/s), 101 generated in 1207 ms (83.7 tok/s), drafts accepted 69 of 83, 6 checkpoints prefill copy_i32: an illegal memory access was encountered ``` So the trigger is not "cold long prompt with a large chunk" alone: every cold synthetic run here (61k-262k, 58 requests) stayed clean, while the reused-prefix chat path faulted. Long context and/or the prefix-reuse path look like the more likely common factor, and I over-claimed in the previous update. **2. The fault hangs the engine here (spin, not a clean error)** Unlike jhardin1's box (clean HTTP 400, engine exits), here the engine spins: the process keeps burning CPU (~5 threads pinned, ~30 s of CPU per 6 s wall) while both GPUs sit at 0%, and /status stays "reading the prompt" for 40+ minutes with no recovery. It has to be killed by hand. **3. Attached** strata_hang_8680.dmp - a mini dump of the hung process, taken while it was spinning (thread stacks + module list). No debugger was installed on this box, so I could not read the stacks myself. The spinning threads are 5, all in state Running, with both GPUs idle at capture time. [strata_hang_8680.dmp](https://github.com/user-attachments/files/33278614/strata_hang_8680.dmp)
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026):

Another data point, from a Radeon AI PRO R9700 (gfx1201, HIP) where one arm of this is deterministic rather than intermittent.

Setup: Strata 0.1.39 (HIP build, ROCm 7.10 "TheRock" userspace), 1× R9700 32 GB, 64 GB RAM, Linux kernel 6.17, Qwen3.8-Flash-Next IQ3_XXS (GSQ-RCO pack), --max-context 131072 --kv int8 --prefill auto --spec 4 --mtp. --prefill auto resolves to an 8192 chunk on this box, so the large-chunk variable of the original report is not in play here.

Deterministic arm — STRATA_HIP_WMMA=1 (with STRATA_PREFILL_RING=96): a ~28K-token prompt crashes reproducibly in the last prefill chunk. The engine log's final two lines:

strata: STRATA_HIP_WMMA: the prompt attention on matrix cores on (gfx1201)
prefill copy_i32: an illegal memory access was encountered

The kernel log at the same moment shows amdgpu ... [gfxhub] page fault ... PERMISSION_FAULTS: 0x5 for the strata process — i.e. the process exits only after the GPU has already faulted, which is why copy_i32's check() reports it (it reads last-error state).

Same prompt with STRATA_HIP_WMMA unset: passes. 28K and 93K prompts both complete with no page fault. docs/AMD_HIP.md documents the matrix-core prompt attention as opt-in and "not validated" beyond 16K context, which is about where ours starts failing — worth knowing whether that limit is what the reporters above are hitting at their chunk sizes.

Non-WMMA arm: with WMMA off we still saw 3 crashes over ~4 h of real agent traffic on 63K / 77K / 85K prompts (chunk 8192, no WMMA, no pipeline-windows). So WMMA is a sufficient but not necessary trigger, and the fault looks asynchronous relative to copy_i32 — consistent with the cross-stream suspicion in this thread (m.copy vs the KV staging stream in check()).

Happy to run the requested controls on this exact box — WMMA on/off × --prefill 8192/16384/32768, STRATA_PF_STEP_SYNC=1 on/off — and to attach a full startup log. The WMMA arm is reproducible on demand, which may be a cheaper reproduction than the intermittent one.

<!-- gh-comment-id:6099145519 --> @aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026): Another data point, from a Radeon AI PRO R9700 (gfx1201, HIP) where one arm of this is **deterministic** rather than intermittent. **Setup:** Strata 0.1.39 (HIP build, ROCm 7.10 "TheRock" userspace), 1× R9700 32 GB, 64 GB RAM, Linux kernel 6.17, Qwen3.8-Flash-Next **IQ3_XXS** (GSQ-RCO pack), `--max-context 131072 --kv int8 --prefill auto --spec 4 --mtp`. `--prefill auto` resolves to an **8192** chunk on this box, so the large-chunk variable of the original report is not in play here. **Deterministic arm — `STRATA_HIP_WMMA=1`** (with `STRATA_PREFILL_RING=96`): a ~28K-token prompt crashes reproducibly in the last prefill chunk. The engine log's final two lines: ``` strata: STRATA_HIP_WMMA: the prompt attention on matrix cores on (gfx1201) prefill copy_i32: an illegal memory access was encountered ``` The kernel log at the same moment shows `amdgpu ... [gfxhub] page fault ... PERMISSION_FAULTS: 0x5` for the `strata` process — i.e. the process exits only after the GPU has already faulted, which is why `copy_i32`'s `check()` reports it (it reads last-error state). **Same prompt with `STRATA_HIP_WMMA` unset:** passes. 28K and 93K prompts both complete with no page fault. `docs/AMD_HIP.md` documents the matrix-core prompt attention as opt-in and "not validated" beyond 16K context, which is about where ours starts failing — worth knowing whether that limit is what the reporters above are hitting at their chunk sizes. **Non-WMMA arm:** with WMMA off we still saw 3 crashes over ~4 h of real agent traffic on 63K / 77K / 85K prompts (chunk 8192, no WMMA, no pipeline-windows). So WMMA is a sufficient but not necessary trigger, and the fault looks asynchronous relative to `copy_i32` — consistent with the cross-stream suspicion in this thread (`m.copy` vs the KV staging stream in `check()`). Happy to run the requested controls on this exact box — WMMA on/off × `--prefill` 8192/16384/32768, `STRATA_PF_STEP_SYNC=1` on/off — and to attach a full startup log. The WMMA arm is reproducible on demand, which may be a cheaper reproduction than the intermittent one.
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026):

Follow-up on the same box after upgrading to 0.1.41 (same hardware and config as my comment above: R9700 gfx1201, Qwen3.8-Flash-Next IQ3_XXS, --max-context 131072 --kv int8 --prefill auto → resolves to chunk 8192, no WMMA):

The crash survives 0.1.41 with no WMMA and an 8192 chunk. Single-prompt sweep, engine log line for each:

  • prompt 62,873 tokens = 0 reused + 62,873 read in 50925 ms (1234.6 tok/s) — OK
  • prompt 76,740 tokens = 32768 reused + 43972 read in 37006 ms (1188.2 tok/s) — OK
  • ~85K tokens → prefill copy_i32: an illegal memory access was encountered, with the matching kernel line amdgpu ... [gfxhub] page fault. Same signature as before.
  • prompt 90,920 tokens = 0 reused + 90,920 read in 78202 ms (1162.6 tok/s) — prefill succeeded, but the reply degenerated to 64 ! characters.

So on this box the remaining trigger is prompt length itself (~77K ok, ~85K faults) and is independent of chunk size and of WMMA.

The STRATA_HIP_WMMA=1 arm no longer reproduces on 0.1.41. With STRATA_HIP_WMMA=1 STRATA_PREFILL_RING=96, the 28K-token prompt that faulted on every attempt under 0.1.39 now completes: prompt 28,164 tokens = 0 reused + 28,164 read in 15007 ms (1876.7 tok/s), no page fault. If the WMMA prompt-attention path was reaching the same staging/fault code, something in 0.1.40/0.1.41 changed it — which would mean the long-prompt fault above is a second path into it, not the chunk-size one.

The !!!! reply after the 90,920-token prompt may be related to the stage-pinning change in 0.1.41 (STRATA_STAGE_PIN=1 is now opt-in): is that symptom expected to need the pin set explicitly for very long prompts, or should the default path handle it?

WMMA is still a large prompt-speed lever here — 1,876 tok/s vs ~1,180 tok/s at 28K — but we keep it off given the above. Happy to run the controls the maintainer would like (WMMA × --prefill 8192/16384/32768 × STRATA_PF_STEP_SYNC=1) on this exact box.

<!-- gh-comment-id:6099431418 --> @aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026): Follow-up on the same box after upgrading to 0.1.41 (same hardware and config as my comment above: R9700 gfx1201, Qwen3.8-Flash-Next IQ3_XXS, `--max-context 131072 --kv int8 --prefill auto` → resolves to chunk 8192, no WMMA): **The crash survives 0.1.41 with no WMMA and an 8192 chunk.** Single-prompt sweep, engine log line for each: - `prompt 62,873 tokens = 0 reused + 62,873 read in 50925 ms (1234.6 tok/s)` — OK - `prompt 76,740 tokens = 32768 reused + 43972 read in 37006 ms (1188.2 tok/s)` — OK - **`~85K tokens` → `prefill copy_i32: an illegal memory access was encountered`**, with the matching kernel line `amdgpu ... [gfxhub] page fault`. Same signature as before. - `prompt 90,920 tokens = 0 reused + 90,920 read in 78202 ms (1162.6 tok/s)` — prefill succeeded, but the reply degenerated to 64 `!` characters. So on this box the remaining trigger is **prompt length itself** (~77K ok, ~85K faults) and is independent of chunk size and of WMMA. **The `STRATA_HIP_WMMA=1` arm no longer reproduces on 0.1.41.** With `STRATA_HIP_WMMA=1 STRATA_PREFILL_RING=96`, the 28K-token prompt that faulted on every attempt under 0.1.39 now completes: `prompt 28,164 tokens = 0 reused + 28,164 read in 15007 ms (1876.7 tok/s)`, no page fault. If the WMMA prompt-attention path was reaching the same staging/fault code, something in 0.1.40/0.1.41 changed it — which would mean the long-prompt fault above is a *second* path into it, not the chunk-size one. The `!!!!` reply after the 90,920-token prompt may be related to the stage-pinning change in 0.1.41 (`STRATA_STAGE_PIN=1` is now opt-in): is that symptom expected to need the pin set explicitly for very long prompts, or should the default path handle it? WMMA is still a large prompt-speed lever here — 1,876 tok/s vs ~1,180 tok/s at 28K — but we keep it off given the above. Happy to run the controls the maintainer would like (WMMA × `--prefill` 8192/16384/32768 × `STRATA_PF_STEP_SYNC=1`) on this exact box.
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026):

A third signature from this box, and it is at a much shorter prompt — it names the PLE path, not copy_i32.

Context: 0.1.41, WMMA off, --prefill auto (chunk 8192), --max-context 131072 --kv int8, IQ3_XXS. This was an ordinary agent request (a ~40K-token system prompt), not a stress test:

strata serve: prompt 39706 tokens = 39670 reused + 36 read in 319 ms (112.9 tok/s), 10 generated in 121 ms (82.4 tok/s), drafts accepted ...
strata serve: decode expert cache hit rate: 96.6% (5939 hits / 6149 lookups); 91 more read by the GPU over PCIe or from another GPU (1.5% ...
strata serve: prefill: the PLE rows' upload failed: an illegal memory access was encountered
[strata] 2026-10-10 12:03:03 engine started: ...        <- engine restarted itself

The client saw the request fail and the retry succeeded. Note the wording: the PLE rows' upload failed — a different site from prefill copy_i32. If copy_i32's check() is only reading last-error state, the actual fault may be landing in the PLE upload path and being reported by whichever call checks next.

We do not set --ple-io; the only PLE-related setting we carry is STRATA_PLE_BATCH=0 (kept on the advice in #224/#541). Happy to A/B that switch if it helps isolate this.

Two corrections to my earlier comments, for the record:

  • The non-WMMA crash we saw was after a 76,740-token prompt (I said "~85K"); the 85K-length runs passed when repeated.
  • On 0.1.41, with WMMA off, an 85K prompt passed twice in a row after having faulted once — so the long-prompt fault is intermittent in both arms and correlates with prompt length, not with chunk size or WMMA.

We are moving to 0.1.42 next (the PLE probe / --ple-io change in #1425/#1549/#1629 looks relevant, as does the fused int8 prompt-expert opt-in) and will report whether any of the three signatures still reproduce.

<!-- gh-comment-id:6100188173 --> @aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026): A third signature from this box, and it is at a much shorter prompt — it names the **PLE path**, not `copy_i32`. **Context:** 0.1.41, WMMA off, `--prefill auto` (chunk 8192), `--max-context 131072 --kv int8`, IQ3_XXS. This was an ordinary agent request (a ~40K-token system prompt), not a stress test: ``` strata serve: prompt 39706 tokens = 39670 reused + 36 read in 319 ms (112.9 tok/s), 10 generated in 121 ms (82.4 tok/s), drafts accepted ... strata serve: decode expert cache hit rate: 96.6% (5939 hits / 6149 lookups); 91 more read by the GPU over PCIe or from another GPU (1.5% ... strata serve: prefill: the PLE rows' upload failed: an illegal memory access was encountered [strata] 2026-10-10 12:03:03 engine started: ... <- engine restarted itself ``` The client saw the request fail and the retry succeeded. Note the wording: **`the PLE rows' upload failed`** — a different site from `prefill copy_i32`. If `copy_i32`'s `check()` is only reading last-error state, the actual fault may be landing in the PLE upload path and being *reported* by whichever call checks next. We do not set `--ple-io`; the only PLE-related setting we carry is `STRATA_PLE_BATCH=0` (kept on the advice in #224/#541). Happy to A/B that switch if it helps isolate this. **Two corrections to my earlier comments, for the record:** - The non-WMMA crash we saw was after a **76,740**-token prompt (I said "~85K"); the 85K-length runs passed when repeated. - On 0.1.41, with WMMA off, an 85K prompt passed twice in a row after having faulted once — so **the long-prompt fault is intermittent in both arms** and correlates with prompt length, not with chunk size or WMMA. We are moving to 0.1.42 next (the PLE probe / `--ple-io` change in #1425/#1549/#1629 looks relevant, as does the fused int8 prompt-expert opt-in) and will report whether any of the three signatures still reproduce.
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026):

An opt-in 0.1.42 gfx12 prompt-speed switch makes this bug much more frequent on our box — possibly a useful repro lever

Same box and config as above (R9700 gfx1201, IQ3_XXS, 0.1.42, --prefill auto = 8192, WMMA off, --max-context 131072 --kv int8). I measured STRATA_PF_FUSED=1 (#1570, fused int8 prompt experts on gfx12) against the default with an interleaved design: the two arms alternate round by round, each round on a freshly started engine, and every prompt carries a fresh nonce so nothing hits the prefix cache. Prompt ≈40K tokens with a needle at 70% depth.

Arm Runs Clean !!!! reply Crash
default (PF_FUSED off) 7 7 0 0
STRATA_PF_FUSED=1 8 4 2 2

Prefill was ~21% faster with it on (median 1,496 vs 1,237 tok/s), so the switch does what it says.

The failures are the two signatures already in this thread: the reply degenerates into 64 ! characters (needle not found) and the prefill copy_i32 / illegal-memory-access crash. It is not a general quality change — a 10-question deterministic battery (greedy, 200-token cap) was byte-identical between arms in 29/30 cases, and at 63K both arms were 3/3 clean.

That pattern fits the asynchronous-ordering theory in this thread: if the fused prompt path issues the same work in a different order/stream, the window for the staging race opens wider. Consistent with the fact that STRATA_PF_STEP_SYNC=1 changes the reproduction rate for you.

Two practical points:

  1. We cannot enable PF_FUSED while this bug is open. The failure mode is a silent wrong answer, not just a failed request; +21% prompt speed does not pay for a ~50% chance of that at 40K tokens.
  2. It may be a cheap way to raise the reproduction rate when testing a fix — on this box it moved the 40K failure rate from 0/7 to 4/8. Happy to re-run this A/B against any candidate build.

(n is small — 7 vs 8 runs, one-tailed Fisher p ≈ 0.077 — but the direction is consistent across three batches, and for us the cost/benefit is asymmetric.)

<!-- gh-comment-id:6100776827 --> @aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026): **An opt-in 0.1.42 gfx12 prompt-speed switch makes this bug much more frequent on our box — possibly a useful repro lever** Same box and config as above (R9700 gfx1201, IQ3_XXS, 0.1.42, `--prefill auto` = 8192, WMMA off, `--max-context 131072 --kv int8`). I measured `STRATA_PF_FUSED=1` (#1570, fused int8 prompt experts on gfx12) against the default with an interleaved design: the two arms alternate round by round, each round on a freshly started engine, and every prompt carries a fresh nonce so nothing hits the prefix cache. Prompt ≈40K tokens with a needle at 70% depth. | Arm | Runs | Clean | `!!!!` reply | Crash | |---|---|---|---|---| | default (PF_FUSED off) | 7 | **7** | 0 | 0 | | `STRATA_PF_FUSED=1` | 8 | 4 | 2 | 2 | Prefill was ~21% faster with it on (median 1,496 vs 1,237 tok/s), so the switch does what it says. The failures are the two signatures already in this thread: the reply degenerates into 64 `!` characters (needle not found) and the `prefill copy_i32` / illegal-memory-access crash. It is not a general quality change — a 10-question deterministic battery (greedy, 200-token cap) was byte-identical between arms in 29/30 cases, and at 63K both arms were 3/3 clean. That pattern fits the asynchronous-ordering theory in this thread: if the fused prompt path issues the same work in a different order/stream, the window for the staging race opens wider. Consistent with the fact that `STRATA_PF_STEP_SYNC=1` changes the reproduction rate for you. Two practical points: 1. **We cannot enable PF_FUSED while this bug is open.** The failure mode is a silent wrong answer, not just a failed request; +21% prompt speed does not pay for a ~50% chance of that at 40K tokens. 2. It may be a **cheap way to raise the reproduction rate when testing a fix** — on this box it moved the 40K failure rate from 0/7 to 4/8. Happy to re-run this A/B against any candidate build. (n is small — 7 vs 8 runs, one-tailed Fisher p ≈ 0.077 — but the direction is consistent across three batches, and for us the cost/benefit is asymmetric.)
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026):

Counter-data-point on the chunk-size premise: on this box the larger chunk was the cleaner arm

Same machine/config as my comments above (R9700 gfx1201, IQ3_XXS, 0.1.42, WMMA off, --max-context 131072 --kv int8, single card). I ran an interleaved A/B — the two arms alternate round by round, each round on a freshly started engine, every prompt carrying a fresh nonce so nothing hits the prefix cache, a needle at 70% depth — five rounds per arm, at ~40K and ~63K tokens:

Prompt --prefill auto (8192 here) --prefill auto:32768
~40K median 1,261 tok/s, 5/5 clean median 1,288 tok/s, 5/5 clean
~63K median 1,186 tok/s, 3/5 clean (1 crash, 1 !!!! degeneration) median 1,388 tok/s, 5/5 clean

--prefill auto:32768 is accepted on this box (prompt chunk auto: 32768 tokens in the log) and costs nothing else we can see: the expert cache stayed at 14,500 slots and 894 MiB free in both arms, and the larger buffers were lent by the cache without evicting experts.

Two things worth noting:

  1. The direction is the opposite of the report that opened this thread. Here the faults (both signatures — the copy_i32 crash and the !!!! reply) appeared in the 8192 arm, at 63K, and not in the 32768 arm. With 5 runs per arm that is not proof of anything, but combined with the earlier observations in this thread (a 76,740-token prompt faulting at chunk 8192; an 85K prompt passing twice in a row after having faulted once) it argues that chunk size is not the trigger — what tracks the failures is prompt length, intermittently.
  2. We are keeping auto:32768 (it is both faster here and, so far, cleaner), and we still see the bug: our 8192-arm failures above, plus two more occurrences on 0.1.42 with chunk 8192 (a degenerate ! reply and a crash, both on 63–85K prompts).

So if anyone is bisecting this: on an R9700 with IQ3_XXS, --prefill auto:32768 is not a reproduction aid for us — --prefill auto (8192) reproduced the faults while 32768 ran clean in the same protocol. If somebody on a 32 GB AMD card is looking for a way to raise the rate, the two levers we found that do are STRATA_HIP_WMMA=1 on 0.1.39 (deterministic, since fixed in 0.1.41) and STRATA_PF_FUSED=1 on 0.1.42 (4 failures in 8 runs at 40K, versus 0 in 7 without it).

<!-- gh-comment-id:6101685355 --> @aiworkeryuan-chuxi commented on GitHub (Oct 10, 2026): **Counter-data-point on the chunk-size premise: on this box the larger chunk was the *cleaner* arm** Same machine/config as my comments above (R9700 gfx1201, IQ3_XXS, 0.1.42, WMMA off, `--max-context 131072 --kv int8`, single card). I ran an interleaved A/B — the two arms alternate round by round, each round on a freshly started engine, every prompt carrying a fresh nonce so nothing hits the prefix cache, a needle at 70% depth — five rounds per arm, at ~40K and ~63K tokens: | Prompt | `--prefill auto` (8192 here) | `--prefill auto:32768` | |---|---|---| | ~40K | median **1,261 tok/s**, 5/5 clean | median **1,288 tok/s**, 5/5 clean | | ~63K | median **1,186 tok/s**, **3/5 clean** (1 crash, 1 `!!!!` degeneration) | median **1,388 tok/s**, **5/5 clean** | `--prefill auto:32768` is accepted on this box (`prompt chunk auto: 32768 tokens` in the log) and costs nothing else we can see: the expert cache stayed at 14,500 slots and 894 MiB free in both arms, and the larger buffers were lent by the cache without evicting experts. Two things worth noting: 1. **The direction is the opposite of the report that opened this thread.** Here the faults (both signatures — the `copy_i32` crash and the `!!!!` reply) appeared in the **8192** arm, at 63K, and not in the 32768 arm. With 5 runs per arm that is not proof of anything, but combined with the earlier observations in this thread (a 76,740-token prompt faulting at chunk 8192; an 85K prompt passing twice in a row after having faulted once) it argues that **chunk size is not the trigger** — what tracks the failures is prompt length, intermittently. 2. We are keeping `auto:32768` (it is both faster here and, so far, cleaner), and we still see the bug: our 8192-arm failures above, plus two more occurrences on 0.1.42 with chunk 8192 (a degenerate `!` reply and a crash, both on 63–85K prompts). So if anyone is bisecting this: on an R9700 with IQ3_XXS, `--prefill auto:32768` is not a reproduction aid for us — `--prefill auto` (8192) reproduced the faults while `32768` ran clean in the same protocol. If somebody on a 32 GB AMD card is looking for a way to *raise* the rate, the two levers we found that do are `STRATA_HIP_WMMA=1` on 0.1.39 (deterministic, since fixed in 0.1.41) and `STRATA_PF_FUSED=1` on 0.1.42 (4 failures in 8 runs at 40K, versus 0 in 7 without it).
Author
Owner

@aiworkeryuan-chuxi commented on GitHub (Oct 12, 2026):

AMD/HIP arm (single Radeon AI PRO R9700, gfx1201) — the ablation controls you asked for, plus two asymmetries vs the CUDA boxes

We are the gfx1201/HIP side of this thread. Everything below is single-card HIP, engine 0.1.42 built locally against a ROCm 7.10 "TheRock" userspace, 61 GB RAM, kernel 6.17, --max-context 131072 --kv int8 --spec 4 --spec-min-p 0.5 --mtp rt --vram-reserve-mib 1000, WMMA off (default), STRATA_PF_FUSED unset (0.1.42 default off). Cold needle prompts (needle at 70 % depth, fresh nonce per request, so nothing hits the prefix cache).

First: our weights are NOT the pinned pack

Ours is ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF (rev ed59f920), IQ3_XXS — shard 1 47,039,860,096 B, SHA-256 219ea929900dfa9ef091f3aa473fdba6874b65fcb36526d7d851ac9e95856d15; shard 2 28,800,138,432 B. The pack pinned in this thread (SC117/...-abliterated, rev eec4e10) is shard 1 47,342,144,896 B / 03b11926…42fdc5. As you said, a similarly named pack is not the same reproduction — so treat this as a same-signature / different-weights data point. We can pull eec4e10 (76 GB, ~80 MB/s here) and re-run the 93K arm on the exact pack if that is worth your time.

1. On this box the chunk premise is inverted, and the fault edge is ~85–93K

--prefill auto resolves to 8192 here, auto:32768 to 32768.

target actual resolved chunk result prefill
63 K 61,811 32768 PASS 1,374 tok/s
76 K 75,768 32768 PASS 1,349
85 K 84,537 32768 PASS 1,384
93 K 91,511 32768 CRASH progress froze at 65,536 of 91,511 (inside the 3rd chunk), engine exit 1, last engine line prefill copy_i32: an illegal memory access was encountered

The trigger here is prompt length alone (clean at 85K, dies at 93K) with the large chunk — the opposite of the report that opened this thread, and consistent with our 2026-10-10 run where auto:32768 was the cleaner arm. Event rate at 93K at this chunk is ≈ 1 in 13 requests, so the arm comparison below is a null result at n=4, not evidence of "no effect".

2. The two controls you asked for do not change our failure rate

Interleaved A/B, engine restarted per arm (the env is read at start), fresh nonce per request, 4 rounds × 2 lengths (25 requests):

arm 85 K 93 K prefill median
A baseline 4/4 PASS 4/4 PASS 1,348 / 1,338 tok/s
B STRATA_PROMPT_ATTN_OLD=1 4/4 PASS 4/4 PASS 1,356 / 1,318
C STRATA_PF_STEP_SYNC=1 3 PASS + 1 !!!! 4/4 PASS 1,368 / 1,308
D (93 K only) HIP_LAUNCH_BLOCKING=1 + AMD_SERIALIZE_KERNEL=3 — 1/1 PASS 1,059

Two readings worth having:

  • STRATA_PROMPT_ATTN_OLD=1 is invisible on gfx1201/HIP. Prefill 1,318–1,373 vs baseline 1,336–1,359 tok/s — inside noise — and no change in fault count. On your CUDA arms it cost 40–65 % (71–85 s vs ~51 s), so you could see it was taken. Here we cannot tell whether the fallback QSA path is selected at all, so this box gives no signal either way on "does the QSA prompt attention carry the fault".
  • The HIP equivalent of CUDA_LAUNCH_BLOCKING=1 does not hang. HIP_LAUNCH_BLOCKING=1 + AMD_SERIALIZE_KERNEL=3 starts normally and completes a 93K prompt in 86.4 s (prefill 1,059 tok/s, ≈20 % slower than baseline) with no hang — unlike the CUDA boxes where CLB=1 froze prefill forever and the faulting kernel could never be named. On HIP this is a usable diagnostic arm: results below show a fully serialized run still degenerates, i.e. the fault does not require the async overlap.

--vision / --trim-stage-weights have no counterpart here: single card, no --layer-split, and neither flag is in our start line — so arms (1) and (2) of your matrix cannot be produced on this machine.

3. Where we can get failures at short length, and what the controls do there

At 40K the production chunk almost never faults on our real traffic, so we used our only short-prompt lever, STRATA_PF_FUSED=1 — the same switch 0.1.43 now defaults ON for IQ3_XXS/IQ3_S (thanks for the STRATA_PF_FUSED=0 escape). Interleaved, 4 rounds, restart per arm, fresh nonce, 40K prompts (5 arms × 4 requests = 20):

arm PASS ! degeneration (64 !) abort prefill median
P0 baseline (PF off) 4 0 0 1,322 tok/s
P1 PF_FUSED=1 3 1 0 1,442
P2 PF_FUSED=1 + PROMPT_ATTN_OLD=1 2 2 0 1,484
P3 PF_FUSED=1 + PF_STEP_SYNC=1 3 1 0 1,371
P4 PF_FUSED=1 + HIP_LAUNCH_BLOCKING=1 + AMD_SERIALIZE_KERNEL=3 3 0 1 (exit −6 SIGABRT) 1,165
  • The failure mode at this length is the silent degeneration — a 40-character ! answer with the needle lost — i.e. the #879 family, not copy_i32. It is also visible in timings: degenerated turns decode at 78–85 tok/s against 125–129 for clean ones.
  • Merged PF arms vs baseline: 6 failures in 18 vs 0 in 8 (five ! degenerations + one abort). Same direction as our 2026-10-10 run (PF_FUSED=1 4/8 vs 7/7 clean), but n=4 per arm is too small to claim anything: no arm is clean, and neither control is a mitigation on this box (PROMPT_ATTN_OLD 2/4, PF_STEP_SYNC 1/4, PF_FUSED alone 1/4, baseline 0/4). Running full serialization (P4) did not remove it either — re-tested twice afterwards: one PASS, one ! degeneration.
  • P4's abort is a different bug, not this one: exit code -6 (SIGABRT), the server's generic "engine stopped unexpectedly", and no illegal memory access line in the engine log. It did not reproduce in the two re-tests (1 of 3 requests). Flagging it separately so it does not get counted as a #1468 event.

4. A negative result on the prefix-reuse path

btc1000w's correction says the reused-prefix chat path faults while 58 cold synthetic prompts stayed clean, and our own box's one mid-conversation fault was 39706 tokens = 39670 reused + 36 read (on the PLE upload path). We tried to reproduce that deliberately with a single message that grows turn by turn (same prefix, one new segment per turn). It failed as an experiment: the engine reported 0 reused + N read on every turn — a growing single-message request does not reuse a prefix at all here. So "the new text is a superset of the last prompt" is not enough; the reuse path needs a real multi-turn conversation structure. Recorded as a null result rather than as evidence about the bug.

5. Practical note for 0.1.43 on AMD

--prefill auto:32768 costs nothing else on this box (expert cache stayed at 14,499 slots, 894 MiB free, larger buffers lent by the cache without evicting experts) and was the cleaner arm at 63K in our 10-10 interleaved run (5/5 vs 3/5). Also, our start log shows PLE direct read probe: 92753 rows/s (fine), i.e. the 0.1.42 mmap switch behind #1984 does not apply here — that one is not in play for this box.

Happy to hand over the small harness (interleaved arm driver, a config editor that refuses to leave an unpaired flag/value, the needle probe, per-arm failure counting) or to run the exact eec4e10 pack / a larger n at 93K if that is more useful than direction.

<!-- gh-comment-id:6131239100 --> @aiworkeryuan-chuxi commented on GitHub (Oct 12, 2026): **AMD/HIP arm (single Radeon AI PRO R9700, gfx1201) — the ablation controls you asked for, plus two asymmetries vs the CUDA boxes** We are the gfx1201/HIP side of this thread. Everything below is **single-card HIP**, engine **0.1.42** built locally against a ROCm 7.10 "TheRock" userspace, 61 GB RAM, kernel 6.17, `--max-context 131072 --kv int8 --spec 4 --spec-min-p 0.5 --mtp rt --vram-reserve-mib 1000`, WMMA off (default), `STRATA_PF_FUSED` unset (0.1.42 default off). Cold needle prompts (needle at 70 % depth, **fresh nonce per request**, so nothing hits the prefix cache). ### First: our weights are NOT the pinned pack Ours is `ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF` (rev `ed59f920`), IQ3_XXS — shard 1 **47,039,860,096 B**, SHA-256 `219ea929900dfa9ef091f3aa473fdba6874b65fcb36526d7d851ac9e95856d15`; shard 2 28,800,138,432 B. The pack pinned in this thread (`SC117/...-abliterated`, rev `eec4e10`) is shard 1 **47,342,144,896 B** / `03b11926…42fdc5`. As you said, a similarly named pack is not the same reproduction — so treat this as a **same-signature / different-weights** data point. We can pull `eec4e10` (76 GB, ~80 MB/s here) and re-run the 93K arm on the exact pack if that is worth your time. ### 1. On this box the chunk premise is inverted, and the fault edge is ~85–93K `--prefill auto` resolves to **8192** here, `auto:32768` to 32768. | target | actual | resolved chunk | result | prefill | |---|---|---|---|---| | 63 K | 61,811 | 32768 | PASS | 1,374 tok/s | | 76 K | 75,768 | 32768 | PASS | 1,349 | | 85 K | 84,537 | 32768 | PASS | 1,384 | | **93 K** | **91,511** | 32768 | **CRASH** | progress froze at `65,536 of 91,511` (inside the 3rd chunk), engine exit 1, last engine line `prefill copy_i32: an illegal memory access was encountered` | The trigger here is prompt length alone (clean at 85K, dies at 93K) with the *large* chunk — the opposite of the report that opened this thread, and consistent with our 2026-10-10 run where `auto:32768` was the cleaner arm. Event rate at 93K at this chunk is ≈ **1 in 13 requests**, so the arm comparison below is a **null result at n=4, not evidence of "no effect"**. ### 2. The two controls you asked for do not change our failure rate Interleaved A/B, engine restarted per arm (the env is read at start), fresh nonce per request, 4 rounds × 2 lengths (25 requests): | arm | 85 K | 93 K | prefill median | |---|---|---|---| | A baseline | 4/4 PASS | 4/4 PASS | 1,348 / 1,338 tok/s | | B `STRATA_PROMPT_ATTN_OLD=1` | 4/4 PASS | 4/4 PASS | 1,356 / 1,318 | | C `STRATA_PF_STEP_SYNC=1` | 3 PASS + 1 `!!!!` | 4/4 PASS | 1,368 / 1,308 | | D (93 K only) `HIP_LAUNCH_BLOCKING=1` + `AMD_SERIALIZE_KERNEL=3` | — | 1/1 PASS | **1,059** | Two readings worth having: - **`STRATA_PROMPT_ATTN_OLD=1` is invisible on gfx1201/HIP.** Prefill 1,318–1,373 vs baseline 1,336–1,359 tok/s — inside noise — and no change in fault count. On your CUDA arms it cost 40–65 % (71–85 s vs ~51 s), so you could see it was taken. Here we cannot tell whether the fallback QSA path is selected at all, so this box gives **no signal either way** on "does the QSA prompt attention carry the fault". - **The HIP equivalent of `CUDA_LAUNCH_BLOCKING=1` does not hang.** `HIP_LAUNCH_BLOCKING=1` + `AMD_SERIALIZE_KERNEL=3` starts normally and completes a 93K prompt in 86.4 s (prefill 1,059 tok/s, ≈20 % slower than baseline) with no hang — unlike the CUDA boxes where CLB=1 froze prefill forever and the faulting kernel could never be named. **On HIP this is a usable diagnostic arm**: results below show a fully serialized run still degenerates, i.e. the fault does not require the async overlap. `--vision` / `--trim-stage-weights` have **no counterpart here**: single card, no `--layer-split`, and neither flag is in our start line — so arms (1) and (2) of your matrix cannot be produced on this machine. ### 3. Where we *can* get failures at short length, and what the controls do there At 40K the production chunk almost never faults on our real traffic, so we used our only short-prompt lever, `STRATA_PF_FUSED=1` — the same switch 0.1.43 now defaults ON for IQ3_XXS/IQ3_S (thanks for the `STRATA_PF_FUSED=0` escape). Interleaved, 4 rounds, restart per arm, fresh nonce, 40K prompts (5 arms × 4 requests = 20): | arm | PASS | `!` degeneration (64 `!`) | abort | prefill median | |---|---|---|---|---| | P0 baseline (PF off) | **4** | 0 | 0 | 1,322 tok/s | | P1 `PF_FUSED=1` | 3 | 1 | 0 | 1,442 | | P2 `PF_FUSED=1` + `PROMPT_ATTN_OLD=1` | 2 | **2** | 0 | 1,484 | | P3 `PF_FUSED=1` + `PF_STEP_SYNC=1` | 3 | 1 | 0 | 1,371 | | P4 `PF_FUSED=1` + `HIP_LAUNCH_BLOCKING=1` + `AMD_SERIALIZE_KERNEL=3` | 3 | 0 | **1 (exit −6 SIGABRT)** | 1,165 | - The failure mode at this length is the **silent degeneration** — a 40-character `!` answer with the needle lost — i.e. the #879 family, not `copy_i32`. It is also visible in timings: degenerated turns decode at **78–85 tok/s** against 125–129 for clean ones. - Merged PF arms vs baseline: **6 failures in 18 vs 0 in 8** (five `!` degenerations + one abort). Same direction as our 2026-10-10 run (`PF_FUSED=1` 4/8 vs 7/7 clean), but n=4 per arm is too small to claim anything: **no arm is clean, and neither control is a mitigation on this box** (`PROMPT_ATTN_OLD` 2/4, `PF_STEP_SYNC` 1/4, `PF_FUSED` alone 1/4, baseline 0/4). Running full serialization (P4) did not remove it either — re-tested twice afterwards: one PASS, one `!` degeneration. - **P4's abort is a different bug, not this one**: `exit code -6 (SIGABRT)`, the server's generic "engine stopped unexpectedly", and **no** `illegal memory access` line in the engine log. It did not reproduce in the two re-tests (1 of 3 requests). Flagging it separately so it does not get counted as a #1468 event. ### 4. A negative result on the prefix-reuse path btc1000w's correction says the reused-prefix chat path faults while 58 cold synthetic prompts stayed clean, and our own box's one mid-conversation fault was `39706 tokens = 39670 reused + 36 read` (on the PLE upload path). We tried to reproduce that deliberately with a single message that grows turn by turn (same prefix, one new segment per turn). It failed as an experiment: **the engine reported `0 reused + N read` on every turn** — a growing single-message request does not reuse a prefix at all here. So "the new text is a superset of the last prompt" is not enough; the reuse path needs a real multi-turn conversation structure. Recorded as a null result rather than as evidence about the bug. ### 5. Practical note for 0.1.43 on AMD `--prefill auto:32768` costs nothing else on this box (expert cache stayed at 14,499 slots, 894 MiB free, larger buffers lent by the cache without evicting experts) and was the **cleaner** arm at 63K in our 10-10 interleaved run (5/5 vs 3/5). Also, our start log shows `PLE direct read probe: 92753 rows/s (fine)`, i.e. the 0.1.42 mmap switch behind #1984 does **not** apply here — that one is not in play for this box. Happy to hand over the small harness (interleaved arm driver, a config editor that refuses to leave an unpaired flag/value, the needle probe, per-arm failure counting) or to run the exact `eec4e10` pack / a larger n at 93K if that is more useful than direction.
Author
Owner

@btc1000w commented on GitHub (Oct 13, 2026):

Follow-up on the same Windows dual-16 GB laptop box (RTX 3080 Laptop + RTX 3070 Laptop, WDDM, layer-split 26) that reported the original fault. We dug deeper into the crash on our side. Summary: the Oct 12 pinned-bounce-slot fix (#1996) does not fix this reproduction; the fault localizes to the int8 prompt-attention kernel's reads of the KV staging pool, specifically when that pool is carved from the borrowed expert-cache slots. With the staging pool on its own allocation, 24/24 long-prompt runs are clean, zero driver events.

1. The #1996 fix does not fix this box. Cherry-picked 7bab660b ("Prompt path: every pageable async host-to-device copy goes up through pinned bounce slots") onto v0.1.43 - applied cleanly, built (CUDA, sm_86), same config as the original report. Result: 3 crashes in 15 requests, same signature (prefill copy_i32: an illegal memory access was encountered + engine restart + server reload). So the pageable-async-copy race that #1996 fixes is real but is not this reproduction's root cause.

2. Attribution to the kernel. We built v0.1.43 with two diagnostics (same binary otherwise):

  • Per-stream sync at each prefill step (Momoyeyu's STRATA_PF_STEP_SYNC=3 shape, plus a cudaPeekAtLastError() before any wait). Across 9 crashes the signature is identical: pre=no error, the compute stream m.cs returns the illegal access after blocking 72-125 ms, while m.copy, m.kv_copy and the peer/stage-helper streams return instantly (they only inherit the sticky state). The failing step is always the window around qsa_prompt_attn_batch, where the only in-flight work on m.cs is the tensor-core int8 prompt attention. All 9 crashes were at layers >= 27 - i.e. always on the second layer-split stage (the 3070), never on the 3080.
  • A tight-bounds check inside the kernel (armed per launch with the staging pool's real row count 524,288 and page count 65,536; violations recorded to a host-mapped flag readable after the fault). Positive control confirmed the check was live (i8-diag: armed ... in the log). Across 5 crashes: zero violations - selection cells and page-table-derived KV rows were never out of bounds. So the illegal access is not an index overflow in this kernel. (The earlier "I8-OOB build runs clean" result on our box was timing perturbation, not a fix - it also never printed a violation.)

3. The fault is driver-level. Every crash lines up with a Windows event nvlddmkm ID 153: Error occurred on GPUID: 500 - a real GPU MMU fault, not just a sticky CUDA error. In a 40-minute window with the fault absent, the event count is 0.

4. The decisive A/B - where the staging pool lives. By default take_stage carves the KV staging pool out of the slots the prompt path borrows from the expert cache (our log: "CUDA1 prompt path borrows 4101 of its 5701 slots (7.54 GiB)"). With the existing A/B env var STRATA_KV_STAGE_OWN=1 (the staging pool gets its own allocation instead), 24/24 cold 135k-token runs completed, zero crashes, zero nvlddmkm ID 153 events, prefill throughput unchanged (~1,890 tok/s). Same engine binary; baseline without the variable on the same day: 4/12 and 5/12 crashes.

That points at the borrow: the attention kernel's reads of the staging pool fault at the MMU level while its indices are in bounds, and the pool stops faulting once it no longer sits inside the borrowed expert-cache region - consistent with jhardin1's GCVM_L2 signature (page mapped but wrong permission = a buffer repurposed while a reader is in flight) and with the fact that 32 GB cards (no borrow needed) do not reproduce.

What we could not do: instruction-level conviction. On this box CUDA_LAUNCH_BLOCKING=1 hangs the prefill (matches btc1000w's earlier finding and PR #1383); compute-sanitizer memcheck measures ~230x overhead (63 min for a 27.7k prefill) - impractical at 135k; Nsight Compute 2024.3 fails to profile this kernel here (child-process injection lock error; direct-launch wrap dies at the first attention launch on WDDM + cp.async + 45.5 KB dynamic smem). A short reproduction (~16-20k prompt, chunk-0 crashes observed) under memcheck on a machine where ncu works would likely name the instruction.

Suggested next step: consider making the staging pool its own allocation when the borrow is tight (we can A/B STRATA_KV_STAGE_OWN=1-equivalent builds on this box class for as long as useful), or check the borrow/give-back lifetime vs the attention kernel's in-flight reads. Happy to run whatever arms you want; we also have the diagnostics armed image if a specific run would help you.

<!-- gh-comment-id:6143992836 --> @btc1000w commented on GitHub (Oct 13, 2026): Follow-up on the same Windows dual-16 GB laptop box (RTX 3080 Laptop + RTX 3070 Laptop, WDDM, layer-split 26) that reported the original fault. We dug deeper into the crash on our side. Summary: **the Oct 12 pinned-bounce-slot fix (#1996) does not fix this reproduction; the fault localizes to the int8 prompt-attention kernel's reads of the KV staging pool, specifically when that pool is carved from the borrowed expert-cache slots.** With the staging pool on its own allocation, 24/24 long-prompt runs are clean, zero driver events. **1. The #1996 fix does not fix this box.** Cherry-picked 7bab660b ("Prompt path: every pageable async host-to-device copy goes up through pinned bounce slots") onto v0.1.43 - applied cleanly, built (CUDA, sm_86), same config as the original report. Result: 3 crashes in 15 requests, same signature (`prefill copy_i32: an illegal memory access was encountered` + engine restart + server reload). So the pageable-async-copy race that #1996 fixes is real but is not this reproduction's root cause. **2. Attribution to the kernel.** We built v0.1.43 with two diagnostics (same binary otherwise): - Per-stream sync at each prefill step (Momoyeyu's `STRATA_PF_STEP_SYNC=3` shape, plus a `cudaPeekAtLastError()` before any wait). Across 9 crashes the signature is identical: `pre=no error`, the compute stream `m.cs` returns the illegal access after blocking 72-125 ms, while `m.copy`, `m.kv_copy` and the peer/stage-helper streams return instantly (they only inherit the sticky state). The failing step is always the window around `qsa_prompt_attn_batch`, where the only in-flight work on `m.cs` is the tensor-core int8 prompt attention. All 9 crashes were at layers >= 27 - i.e. always on the second layer-split stage (the 3070), never on the 3080. - A tight-bounds check inside the kernel (armed per launch with the staging pool's real row count 524,288 and page count 65,536; violations recorded to a host-mapped flag readable after the fault). Positive control confirmed the check was live (`i8-diag: armed ...` in the log). Across 5 crashes: **zero violations** - selection cells and page-table-derived KV rows were never out of bounds. So the illegal access is not an index overflow in this kernel. (The earlier "I8-OOB build runs clean" result on our box was timing perturbation, not a fix - it also never printed a violation.) **3. The fault is driver-level.** Every crash lines up with a Windows event `nvlddmkm ID 153: Error occurred on GPUID: 500` - a real GPU MMU fault, not just a sticky CUDA error. In a 40-minute window with the fault absent, the event count is 0. **4. The decisive A/B - where the staging pool lives.** By default `take_stage` carves the KV staging pool out of the slots the prompt path borrows from the expert cache (our log: "CUDA1 prompt path borrows 4101 of its 5701 slots (7.54 GiB)"). With the existing A/B env var `STRATA_KV_STAGE_OWN=1` (the staging pool gets its own allocation instead), **24/24 cold 135k-token runs completed, zero crashes, zero `nvlddmkm ID 153` events**, prefill throughput unchanged (~1,890 tok/s). Same engine binary; baseline without the variable on the same day: 4/12 and 5/12 crashes. That points at the borrow: the attention kernel's reads of the staging pool fault at the MMU level while its indices are in bounds, and the pool stops faulting once it no longer sits inside the borrowed expert-cache region - consistent with jhardin1's GCVM_L2 signature (page mapped but wrong permission = a buffer repurposed while a reader is in flight) and with the fact that 32 GB cards (no borrow needed) do not reproduce. **What we could not do:** instruction-level conviction. On this box `CUDA_LAUNCH_BLOCKING=1` hangs the prefill (matches btc1000w's earlier finding and PR #1383); compute-sanitizer memcheck measures ~230x overhead (63 min for a 27.7k prefill) - impractical at 135k; Nsight Compute 2024.3 fails to profile this kernel here (child-process injection lock error; direct-launch wrap dies at the first attention launch on WDDM + cp.async + 45.5 KB dynamic smem). A short reproduction (~16-20k prompt, chunk-0 crashes observed) under memcheck on a machine where ncu works would likely name the instruction. **Suggested next step:** consider making the staging pool its own allocation when the borrow is tight (we can A/B `STRATA_KV_STAGE_OWN=1`-equivalent builds on this box class for as long as useful), or check the borrow/give-back lifetime vs the attention kernel's in-flight reads. Happy to run whatever arms you want; we also have the diagnostics armed image if a specific run would help you.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156100446 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
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#588
No description provided.