mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
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#361
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?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/143
Author: @boxwrench
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:fix/glm-nan-guard📝 Commits (1)
b21f610GLM NaN guard on top of #146: head-logit check that feeds #146's recovery📊 Changes
11 files changed (+235 additions, -0 deletions)
View changed files
📝
docs/SETTINGS.md(+1 -0)📝
include/strata/core/glm_model.hpp(+28 -0)📝
include/strata/kernels/glm_fast.hpp(+6 -0)📝
src/core/glm_dflash.cu(+1 -0)📝
src/core/glm_fast_path.cu(+144 -0)📝
src/core/glm_fast_state.hpp(+2 -0)📝
src/core/glm_model.cu(+3 -0)📝
src/core/glm_mtp.cu(+5 -0)📝
src/core/glm_window.cu(+4 -0)📝
src/kernels/cuda/glm_fast.cu(+23 -0)📝
src/program/generate.cpp(+18 -0)📄 Description
Refs Niko1221/Strata#879 and Niko1221/Strata#1815. Ported from Niko1221/Strata#1892 by lask3802, which fixed the same failure
there: rarely a window's logits become NaN and the reply degenerates into token 0 repeated, and the poison
sits in the conversation's K/V and recurrent state, so a cached continuation stays poisoned.
What it changes
(
glmfast::logits_nonfinite_rows) tests the exponent bits of every row and writes one flag a slice intomapped memory, read after the window's own sync - no extra sync. Covered: the token path (
fast_token),the NextN/MTP verify head (
spec_tail), and the DFlash window (window,win_pipe_part).That hands it to #146's recovery:
drop_if_poisoneddrops the snapshot, the checkpoints and the slots thatmay carry the poison, and the server's retry reads a request that had written nothing yet again from token 0;
a reply that had started ends as
"length". This PR adds no recovery of its own.route_ok). This check reads the headlogits, so it also catches a NaN that appears after the last layer's routing (final norm, head) or only in
the MTP / DFlash window.
STRATA_GLM_NAN_GUARD=0turns it off (no kernel is recorded).STRATA_GLM_NAN_INJECT=<n>[,<n>...](debug) reports the n-th checked window of the process asnon-finite, to exercise the path without a real fire.
What it leaves alone
route_ok) and the DFlash drafter's own picks.Measured
R9700 (gfx1201), Maya-S v2 IQ2_XXS, greedy, one GPU, NO_SPEC, this branch's build.
on both (
STRATA_GLM_PROMOTE=0 STRATA_GLM_PROMOTE_FILL=0 STRATA_GLM_PREFILL_CPU=0 STRATA_GLM_PRESTAGE=0 STRATA_GLM_PCIE_SHARE=0 STRATA_GLM_NO_REUSE=1, one fixed usage profile): byte-identical in 3 of 3.Without pinning, greedy text can differ between two launches of the same config on this box (the timing
based prefill split and the background promotion choose a different CPU/GPU expert set), so the guard
cannot be blamed for that; pinned, the only difference between the arms is the check kernel.
STRATA_GLM_PROF=1:logits_nonfinite0.017 ms/token of 60.43 ms/token of GPU stream time =0.028%, well inside 0.3% (a decode-rate A/B over the same arms cannot resolve a difference that small).
STRATA_GLM_NAN_INJECT=1: the first request's first window was flagged -> the engine loggednon-finite logits (#879)at position 52, emitted none of the window's tokens, dropped the live sessionand the checkpoint, and the server sent the request again from token 0 once (measured on the earlier standalone version; the add-on repeats it through #146's path, see below); the client saw one normal
answer, byte for byte the unpoisoned one.
spec_ready()needs alayer split,
dflash_ready()a drafter), so a forcedSTRATA_GLM_MTP_DRAFT=3run stays token by token;guard on/off is still byte-identical there, and the guard is present at the MTP/DFlash head too.
Credit
The mechanism is Niko1221/Strata#1892 by lask3802; this is its port to Maya's GLM-5.3 engine.
Build and tests
Rebased on main (
a709524, after #146, #145, #154 and #86); 9 files, +174/-0. HIP build (build-multi: HIP on, CUDA off, MMQ, native experts, gfx1100;gfx1201, ROCm 7.2.1): no errors.serve.test_server: 86 tests OK. HIP ctestsampler_parity,glm_model_test,glm_layer_parity: pass. On this base (RX 7900 XT, Maya-S):STRATA_GLM_NAN_INJECT=3(after the first token) ends the reply aslengthwith the state dropped;STRATA_GLM_NAN_INJECT=1(before it) is retried by #146's path and answers; a 64-token greedy request is byte-identical with the guard on and off. The CUDA-side lines are the shared ones (logits_nonfinite_kerneland its launcher, a mappedcudaHostAlloc+cudaHostGetDevicePointerpair,cudaFreeHost). They use nothing HIP-only, but this branch has not been compiled with nvcc here.Not covered: the several-conversations scheduler (
STRATA_GLM_SEQS>1). There, one window can interleave conversations, so a per-sequence flag would be the follow-up.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.