mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #267] GLM router layer 43: deterministic non-finite scores / invalid expert IDs at ~409K context (IQ3_S, 2x gfx1201, 1M ctx, RAM tier + NVMe streaming) - NaN guard retries from token 0 forever #97
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#97
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 @eugenrepp on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/267
Environment
a4e1ff0), HIP source build--glm-pack Maya-L/pack--glm-pack .../Maya-L/pack --max-context 1048576 --expert-cache auto --prefill auto --kv-streaming on --expert-profile expert-profile-glm.bin --kv int8 --kv-resident 32768STRATA_GLM_RAM_GB=80,STRATA_GLM_RESERVE_MB=4096,STRATA_GLM_RAM_HEADROOM_GB=16,STRATA_GLM_PREFILL_SUB=1024,STRATA_GLM_PREFILL_MB=4096What happened
An agentic session (multi-turn, tool calls, thinking on) was running on a 1M-context
instance. Decode was healthy at ~409K context (16-18 tok/s, spec drafts 58-100%
accepted, disk 3.7-7.6 reads/tok). Then:
(1x decode, 36x prompt); from the second retry on, every fire reports exactly
13864 of 65536 routes. The request ends with 0 tokens:Key properties
65536) reproduced on every retry-from-0. Resending is futile.
13,864 invalid routes = 21% - whole token rows of layer 43 are affected, so
the non-finite values are present in the state the router reads, not a rare
scoring outlier.
answered normally throughout; no crash, no illegal memory access.
layer, which is not the last one - consistent with the poison being in the
recurrent/KDA state or the streamed-expert path rather than the head.
conversation was never replayed on them. A 262K instance (v1.1.13,
STRATA_GLM_RAM_GB=106, all experts in RAM, no SSD streaming) ran a day ofsimilar workload without this error (it had an unrelated #29 no-progress
hang once); the 512K instances never received a prompt of this size.
Notes from reading the source (v1.1.15)
route_kernel(glm_batch.cu) already checksisfiniteon logits andbias-adjusted scores and writes
ids = -1for affected tokens; the host-sidecount mismatch in glm_prefill.cu is what produces the "N of 65536 routes"
message. So the report is: non-finite values reach layer 43's router input
at a fixed position, deterministically.
state overflow -> residual -> non-finite) and Strata#2452 (deterministic
non-finite at a fixed prompt position on long context). Happy to add data.
What I can provide
glm stat/glm spec/glm kvlines around everyfire) and the wrapper log.
now runs capped at 512K. If useful, I can spin up a test instance and bisect
the context threshold.
@eugenrepp commented on GitHub (Oct 20, 2026):
Reproduced on the 512K instance — occurs earlier than ~409K
Reproduced on the 512K instance (config
maya-l-512k-80-hip-vision.json, same HW, Maya v1.1.15, started 18.10., no restart since):At 191,457-token prompts (37 % of the 512K window) the same non-finite scores appear in layer 44 (the last layer):
prompt layer 44 … (1368 of 65536 routes)— deterministically on every re-read from token 0 (13 consecutive requests, eachdone: 0 tokens in ~24 s, error), until the client gave up (max_retries_exhausted)Small prompts work fine — the engine stays alive, only the poisoned long prompt is deterministic.
The 512K context cap is therefore not a reliable workaround, and the trigger threshold is lower than the ~409K originally reported. Logs and a client request dump are on file; happy to provide more detail if useful.
@tellmewhattodo commented on GitHub (Oct 23, 2026):
A different trigger path: short context + non-deterministic + recoverable
Reporting a second shape of this guard, because it appears to be the case the report above explicitly calls healthy.
What we saw
The same guard fires, but at a short context:
Environment
451f9cb), CUDA 13.0 source build--glm-pack--glm-pack ... --max-context 32768 --expert-cache auto --prefill auto --kv-streaming on --expert-profile ...git diffon the router and state files)Why this looks like a separate path from the report above
--max-context 32768)The report above states: "Small prompts work fine — the engine stays alive, only the poisoned long prompt is deterministic." What we see is a failure in exactly that regime.
What the guard is actually checking
Reading the routing kernel, the check is:
With no affinity set,
s_selreduces to a sigmoid oflogits, so the condition reduces to the router's raw logits already being non-finite — not a rare scoring outlier at selection time. That is consistent with the report above (whole token rows affected), and is why this does not look like a scheduling or expert-placement problem on our side.Questions
Caveat
We did not keep the raw engine log for the failing runs, and we have not yet attempted to reproduce on current
main. We can try to reproduce with full logs capture on request. Frequency is 2/14, so we cannot estimate a rate.