mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #243] [CLOSED] glm spec: take the NextN head's recurrent-state backup at setup, before the expert pool - no more "the recurrent-state backup did not allocate" at a 200 MB reserve #420
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#420
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/243
Author: @gopinath87607
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:pr/spec-backup📝 Commits (1)
bde81f5glm spec: the head's recurrent-state backup is taken at setup, before the expert pool - the spec path's first decode step could not allocate it once the reserve was not the only room left📊 Changes
3 files changed (+57 additions, -11 deletions)
View changed files
📝
include/strata/core/glm_model.hpp(+2 -0)📝
src/core/glm_fast_path.cu(+52 -8)📝
src/core/glm_window.cu(+3 -3)📄 Description
What this changes
The speculative path's head saves its recurrent (KDA) states into a backup buffer before a decode step and restores them after a rejected draft.
win_reservetook that backup for a DFlash drafter before the expert pool, but its caller is gated ondflash_on_, so the MTP config (a NextN block, no DFlash) still took the backup lazily inspec_kda_copyon the first decode step - after every part's pool had been sized against the reserve. At a 200 MB reserve that malloc fails on all four cards and every request answers HTTP 400glm spec: the recurrent-state backup did not allocate; 700 MB had been enough, but the reserve is not all allocatable (the driver's own cost for a pool this size comes out of it).fast_setupnow reserves it for a NextN split's head group on the same footing aswin_reservedoes for DFlash: the parts[0, h)thatkda_allwalks,hfrompart_/n_parts_becausesplit_next_is linked only after every part has loaded. The size math moves intospec_kda_bytes()/spec_kda_run(), andwin_reservecalls it instead of repeating it. The setup lineglm spec: CUDA%d the head's recurrent-state backup (N MB) before the expert poolmarks it.What it leaves alone
The one-GPU MTP path, DFlash's own reserve, and the
STRATA_GLM_NO_MTP/STRATA_GLM_NO_SPECgates are unchanged. The backup is taken only for the head group of a multi-part NextN split, and only when it is needed (g_.nextn > 0,n_parts_ > 1).Measurements
MTP config, 4 parts,
STRATA_GLM_RESERVE_MB=200: the backup prints on CUDA0 (34 MB) and CUDA1 (30 MB) before the pool lines, and the pools come down by exactly that - 4.47 -> 4.43 GB (384 slots) and 4.46 -> 4.43 GB (408 slots). The 100,534-token read then completes: 100,796.6 ms (1.00 ms/token, 997 tok/s), decode 88.4 ms/token, drafts 74.2%. Before this change every request at that reserve answered HTTP 400 with the allocation error.Checks
src/core/glm_fast_path.cuandsrc/core/glm_window.cucompile clean with the build's own flags (nvcc 13.2, compute_86 + compute_120).python3 tools/check_hip_compat.pypasses.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.