mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1468] prefill copy_i32: illegal memory access on long prompts when the prefill chunk is large (auto:32768) #588
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#588
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @btc1000w on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1468
Summary
prefill copy_i32faults with an illegal memory access on long prompts when the prefill chunk is large, thencheck()callsstd::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:
--prefillauto:327688192auto:16384Removing
--pipeline-windowsdid not stop it (1 crash in 4 requests), so it is not that path.Where it fails
Call sites (all pass
T * Kint32,T= chunk,K= top-k):The engine log line is exactly:
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:
Send a prompt of ~54 K-114 K tokens. The engine logs
prompt chunk auto: 19968 tokens, a 512-slot ringat startup, then crashes within a few long-prompt requests.--prefill auto:16384(or8192) is stable.Environment
BUILD.json, CUDA 13.0, archs 75/86/89/120 + PTX),source: release--layer-split 26(2 stages)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)native_experts.txtregenerated withtools/iq_pack.py --skip-expertsfor this image (so the expert offsets match);dense.bin/index.txtare byte-identical to before--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
Tthan the configured chunk, or a bound thatT * Kcan 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.@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.
@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 20480on 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 * Kis a 64-bit size at the threecopy_i32call sites and the grouping buffer is sized from the sameT * K, so we found no overflow or undersized buffer there.One thing that changes how to look at it:
copy_i32is the first kernel launched after a stream synchronisation, andcheck()reports the sticky error of the last asynchronous failure. So the illegal access most likely comes from a kernel enqueued before it, andcopy_i32is only where it surfaced. Two things would pinpoint it: run once withCUDA_LAUNCH_BLOCKING=1(the engine then names the kernel that faulted), and tell us whether it still happens with--visionremoved 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.@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
d5ea713also 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.
@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 encounteredover ~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.
@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.
@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:
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.
@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.
@Momoyeyu commented on GitHub (Oct 9, 2026):
Exact-pack reproduction attempt on different hardware: reporter-confirmed
SC117/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUFIQ3_XXS at reveec4e10(first shard SHA-25603b11926...42fdc5verified), freshly converted native pack, Strata atd5ea713, 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_qerrors:--prefill 16384baseline andSTRATA_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=1at 16384 (4)Not reproduced. Given your earlier
qsa_prompt_attn_batch/mul_mat_qerrors and thePF_STEP_SYNCmitigation, 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-sidecompute-sanitizer/trap run or the stall dump the maintainer asked for.@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.gguf03b11926b41a3d7f7a008882b1bc7a6330a3c9c43d3cad4598d31dc73042fdc5Same 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_SYNCandCUDA_LAUNCH_BLOCKINGboth unset. Each arm: 5 cold requests (cache_prompt=false), target 102400 tokens (actualprompt_tokens=96689each),max_tokens=16,temperature=0.--vision, keep--trim-stage-weights--vision, drop--trim-stage-weightsSTRATA_PROMPT_ATTN_OLD=1Illegal-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=1is not a complete fixI 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 thestrata pf-step:log lines:strata pf-step: chunk from token 32768, layer 0: ... (no error / no error)immediately precedesprefill copy_i32: an illegal memory access was encounteredSo 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_i32error 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:On 0.1.34-era builds,
prefill mmq: mul_mat_qappeared beforeprefill copy_i32in the same event. On 0.1.41 withauto:16384, only thecopy_i32line 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.
@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):
m.csis the compute stream andm.copythe expert-ring copy stream. In your exact configuration (--layer-split 26,--kv-resident 32768under 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_hostprefetches the [0, p0) prefix through it),s/s_out/s_cp, created on the other GPU byset_stage_helper— used to stream this stage's expert share via the mapped-host route,m.copy, but ordered from a second host thread).So
pf-stepreporting "no error / no error" only bounds cs+copy, andcopy_i32being 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, butcudaDeviceSynchronize()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):Reading the result:
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, theqsa_prompt_attn_batchwindow, or the KV/handoff copies between layer steps).copy_i32keeps 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.@jhardin1 commented on GitHub (Oct 9, 2026):
A different trigger on gfx1030: 1 fault in 12 long prompts with a small
--prefill 512We 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:
and the kernel logged a GPU page fault for that pid:
Note the status:
PERMISSION_FAULTS 0x3withMAPPING_ERROR 0x0— the page is mapped, but not with thepermission the access needed. Your note that
copy_i32is "the first kernel launched after a streamsynchronisation" 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, notauto: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 errorsurfaces
--expert-cache auto→ 13,021 of the model's 24,576 expert slots (26.39 GiB),--kv int8,--max-context 32768/opt/rocm), Ubuntu 24.04, kernel 6.8.0-142, 160 GB host RAM, engine built fromsource (
-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 shere, against ~2.5 min for a cold one) — note
exit code 1, not the watchdog's-6. What the clientgets is a clean
400naming the fault rather than a hang. That distinction is the whole difference fromthe 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 soreusedstays 0:--prefill512auto:16384prompt chunk auto: 16384 tokens, a 384-slot ring)So on this box the fault is rare at both ends of the chunk range — our whole observed rate at
--prefill 512is 1 failure in 36 runs — and the chunk size does not drive it the way it does in your report. Twoother 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 kernelruns first.
A separate finding, if it is useful:
auto:16384is ~18% faster at prompt read than--prefill 512on this box (334 against 282 tok/s, measured in both orders — 24 runs one way, 24 + 12 the other, soit is not warm-up). That matches 0.1.39's note that
autopicks the largest chunk that keeps the ringfull. It cost nothing in faults. No request: just a data point that a fixed small chunk has a price.
@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:
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.
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
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.
@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:
Filling the context, on 0.1.41 + auto:16384 (--max-context 262144):
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.
@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):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=iscudaPeekAtLastError()taken before any wait. Ifpreis 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 wherepreflips.pre=no errorand one named stream returns the error first, that stream's queued work faulted during its wait — that is the attribution we want (kv_copyvshelp.*on the second GPU vscs/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 errorand 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 nameskv_copyor ahelp.*stream, that is exactly the lifecycle I would instrument next.@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:
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
@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 autoresolves 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(withSTRATA_PREFILL_RING=96): a ~28K-token prompt crashes reproducibly in the last prefill chunk. The engine log's final two lines:The kernel log at the same moment shows
amdgpu ... [gfxhub] page fault ... PERMISSION_FAULTS: 0x5for thestrataprocess — i.e. the process exits only after the GPU has already faulted, which is whycopy_i32'scheck()reports it (it reads last-error state).Same prompt with
STRATA_HIP_WMMAunset: passes. 28K and 93K prompts both complete with no page fault.docs/AMD_HIP.mddocuments 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.copyvs the KV staging stream incheck()).Happy to run the requested controls on this exact box — WMMA on/off ×
--prefill8192/16384/32768,STRATA_PF_STEP_SYNC=1on/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.@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)— OKprompt 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 lineamdgpu ... [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=1arm no longer reproduces on 0.1.41. WithSTRATA_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=1is 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 ×
--prefill8192/16384/32768 ×STRATA_PF_STEP_SYNC=1) on this exact box.@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:The client saw the request fail and the retry succeeded. Note the wording:
the PLE rows' upload failed— a different site fromprefill copy_i32. Ifcopy_i32'scheck()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 isSTRATA_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:
We are moving to 0.1.42 next (the PLE probe /
--ple-iochange 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.@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 measuredSTRATA_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.!!!!replySTRATA_PF_FUSED=1Prefill 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 theprefill 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=1changes the reproduction rate for you.Two practical points:
(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.)
@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:--prefill auto(8192 here)--prefill auto:32768!!!!degeneration)--prefill auto:32768is accepted on this box (prompt chunk auto: 32768 tokensin 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:
copy_i32crash 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.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:32768is not a reproduction aid for us —--prefill auto(8192) reproduced the faults while32768ran 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 areSTRATA_HIP_WMMA=1on 0.1.39 (deterministic, since fixed in 0.1.41) andSTRATA_PF_FUSED=1on 0.1.42 (4 failures in 8 runs at 40K, versus 0 in 7 without it).@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_FUSEDunset (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(reved59f920), IQ3_XXS — shard 1 47,039,860,096 B, SHA-256219ea929900dfa9ef091f3aa473fdba6874b65fcb36526d7d851ac9e95856d15; shard 2 28,800,138,432 B. The pack pinned in this thread (SC117/...-abliterated, reveec4e10) 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 pulleec4e10(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 autoresolves to 8192 here,auto:32768to 32768.65,536 of 91,511(inside the 3rd chunk), engine exit 1, last engine lineprefill copy_i32: an illegal memory access was encounteredThe 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:32768was 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):
STRATA_PROMPT_ATTN_OLD=1STRATA_PF_STEP_SYNC=1!!!!HIP_LAUNCH_BLOCKING=1+AMD_SERIALIZE_KERNEL=3Two readings worth having:
STRATA_PROMPT_ATTN_OLD=1is 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".CUDA_LAUNCH_BLOCKING=1does not hang.HIP_LAUNCH_BLOCKING=1+AMD_SERIALIZE_KERNEL=3starts 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-weightshave 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 theSTRATA_PF_FUSED=0escape). Interleaved, 4 rounds, restart per arm, fresh nonce, 40K prompts (5 arms × 4 requests = 20):!degeneration (64!)PF_FUSED=1PF_FUSED=1+PROMPT_ATTN_OLD=1PF_FUSED=1+PF_STEP_SYNC=1PF_FUSED=1+HIP_LAUNCH_BLOCKING=1+AMD_SERIALIZE_KERNEL=3!answer with the needle lost — i.e. the #879 family, notcopy_i32. It is also visible in timings: degenerated turns decode at 78–85 tok/s against 125–129 for clean ones.!degenerations + one abort). Same direction as our 2026-10-10 run (PF_FUSED=14/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_OLD2/4,PF_STEP_SYNC1/4,PF_FUSEDalone 1/4, baseline 0/4). Running full serialization (P4) did not remove it either — re-tested twice afterwards: one PASS, one!degeneration.exit code -6 (SIGABRT), the server's generic "engine stopped unexpectedly", and noillegal memory accessline 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 reported0 reused + N readon 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:32768costs 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 showsPLE 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
eec4e10pack / a larger n at 93K if that is more useful than direction.@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):
STRATA_PF_STEP_SYNC=3shape, plus acudaPeekAtLastError()before any wait). Across 9 crashes the signature is identical:pre=no error, the compute streamm.csreturns the illegal access after blocking 72-125 ms, whilem.copy,m.kv_copyand the peer/stage-helper streams return instantly (they only inherit the sticky state). The failing step is always the window aroundqsa_prompt_attn_batch, where the only in-flight work onm.csis 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.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_stagecarves 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 varSTRATA_KV_STAGE_OWN=1(the staging pool gets its own allocation instead), 24/24 cold 135k-token runs completed, zero crashes, zeronvlddmkm ID 153events, 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=1hangs 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.@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.