[GH-ISSUE #50] Illegal memory access on the next long prompt after decoding with STRATA_GLM_CPU_PLAN=012345678 (CPU lane takes every RAM-tier expert) #20

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

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

Version: v1.0.15 (63e3b7c) clean build, same on v1.0.16; CUDA 12.8, archs 75;86, Linux Mint.
Setup: RTX 3090 (layers 0-28) + RTX 3060 12 GB (29-44 + NextN), Maya-M, --max-context 131072,
STRATA_GLM_SPLIT=29 STRATA_GLM_PREFILL_MB=3072 STRATA_GLM_RAM_RESIDENT=1.

Trigger: STRATA_GLM_CPU_PLAN=012345678 - of f RAM-tier experts in a route the CPU lane takes all f, so nothing
is fetched over PCIe and nothing is promoted. The calibrated plans (e.g. 011233456) and 012234567 do not crash.

Sequence (the --bench order): three greedy answers of 256 tokens (fine: ~17.8 tok/s, 0 RAM fetches,
0 promotions a token), a 2048-token prompt (fine), then an 8192-token prompt:

glm_fast tab_update: an illegal memory access was encountered
prefill mmq: iota: an illegal memory access was encountered
NVRM: Xid (PCI:0000:0b:00): 13, Graphics SM Warp Exception ... Out Of Range Address   <- the 3060 (tail half)

Reproduced 4 times (once on the clean v1.0.15 build), also with STRATA_GLM_SLOTS=0. Not narrowed down further.
Suspicion: the prompt path lending the pool tail when no route ever promoted into the spares, or a route whose
cpu_mask covers all 8 experts.

(A different crash - prompt chunks over ~9K tokens on a split - is explained and fixed in #47.)


The tests, the measurements and this report were produced with the help of Claude, an AI assistant by Anthropic.

Originally created by @sociolog on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/50 **Version:** v1.0.15 (63e3b7c) clean build, same on v1.0.16; CUDA 12.8, archs 75;86, Linux Mint. **Setup:** RTX 3090 (layers 0-28) + RTX 3060 12 GB (29-44 + NextN), Maya-M, `--max-context 131072`, `STRATA_GLM_SPLIT=29 STRATA_GLM_PREFILL_MB=3072 STRATA_GLM_RAM_RESIDENT=1`. **Trigger:** `STRATA_GLM_CPU_PLAN=012345678` - of f RAM-tier experts in a route the CPU lane takes all f, so nothing is fetched over PCIe and nothing is promoted. The calibrated plans (e.g. 011233456) and 012234567 do not crash. **Sequence** (the `--bench` order): three greedy answers of 256 tokens (fine: ~17.8 tok/s, 0 RAM fetches, 0 promotions a token), a 2048-token prompt (fine), then an 8192-token prompt: glm_fast tab_update: an illegal memory access was encountered prefill mmq: iota: an illegal memory access was encountered NVRM: Xid (PCI:0000:0b:00): 13, Graphics SM Warp Exception ... Out Of Range Address <- the 3060 (tail half) Reproduced 4 times (once on the clean v1.0.15 build), also with `STRATA_GLM_SLOTS=0`. Not narrowed down further. Suspicion: the prompt path lending the pool tail when no route ever promoted into the spares, or a route whose cpu_mask covers all 8 experts. (A different crash - prompt chunks over ~9K tokens on a split - is explained and fixed in #47.) --- *The tests, the measurements and this report were produced with the help of Claude, an AI assistant by Anthropic.*
Author
Owner

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

Tested on CUDA: open PR #39 (lending races / invalid routes) fixes this - with it the 8192-token prompt after the all-CPU-plan decode runs fine twice, without it the illegal memory access returns (details in #39). I will close this issue when #39 is merged.


The tests, the measurements and this comment were produced with the help of Claude, an AI assistant by Anthropic.

<!-- gh-comment-id:6082528245 --> @sociolog commented on GitHub (Oct 9, 2026): Tested on CUDA: open PR #39 (lending races / invalid routes) fixes this - with it the 8192-token prompt after the all-CPU-plan decode runs fine twice, without it the illegal memory access returns (details in #39). I will close this issue when #39 is merged. --- *The tests, the measurements and this comment were produced with the help of Claude, an AI assistant by Anthropic.*
Author
Owner

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

This matches a race we found on AMD that is in shared code, so NVIDIA has it too: #39 (rebased on current main). With an all-CPU plan the CPU lane takes every RAM-tier expert, and background promotions run; prompt lending could then start while a promotion targeted a tail slot that gets lent, and separately the boundary's pinned table-update buffers could be rewritten while their copy was still in flight - your first error, glm_fast tab_update: an illegal memory access, is exactly what we saw. In our verification, STRATA_GLM_CPU_PLAN=012345678 with the RAM-resident tier ran 3,371 background promotions without an error, and long prompts (8K-28K) passed. If you can try the branch boxwrench:fix/tier-lending-races on your 3090 + 3060 setup, a confirmation on CUDA would help the maintainer merge it.

<!-- gh-comment-id:6083126538 --> @boxwrench commented on GitHub (Oct 9, 2026): This matches a race we found on AMD that is in shared code, so NVIDIA has it too: #39 (rebased on current main). With an all-CPU plan the CPU lane takes every RAM-tier expert, and background promotions run; prompt lending could then start while a promotion targeted a tail slot that gets lent, and separately the boundary's pinned table-update buffers could be rewritten while their copy was still in flight - your first error, `glm_fast tab_update: an illegal memory access`, is exactly what we saw. In our verification, `STRATA_GLM_CPU_PLAN=012345678` with the RAM-resident tier ran 3,371 background promotions without an error, and long prompts (8K-28K) passed. If you can try the branch `boxwrench:fix/tier-lending-races` on your 3090 + 3060 setup, a confirmation on CUDA would help the maintainer merge it.
Author
Owner

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

Fixed in v1.0.27 by #39, which you confirmed on CUDA. Thank you for the report and the test! Closing. If it comes back on v1.0.27, please reopen.

<!-- gh-comment-id:6088021640 --> @mw00 commented on GitHub (Oct 9, 2026): Fixed in v1.0.27 by #39, which you confirmed on CUDA. Thank you for the report and the test! Closing. If it comes back on v1.0.27, please reopen.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#20
No description provided.