mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #283] [CLOSED] glm prefill: more memory for a long prompt while it reads #445
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#445
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/283
Author: @gopinath87607
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:pr/room-draft-lend📝 Commits (2)
6b40fddglm prefill: what only the decode needs leaves VRAM while a prompt runs - a split's prestage ring takes the whole loan, and a long prompt takes the DFlash drafter's 0.7 GB (or an MTP block's slots) back as more ring (STRATA_GLM_ROOM_MIN, unset = off)e5285d4glm prefill: the room's threshold counts the tokens a request READS, not the whole prompt📊 Changes
6 files changed (+469 additions, -34 deletions)
View changed files
📝
docs/SETTINGS.md(+2 -1)📝
include/strata/core/glm_dflash.hpp(+10 -0)📝
include/strata/core/glm_model.hpp(+7 -0)📝
src/core/glm_dflash.cu(+153 -11)📝
src/core/glm_fast_path.cu(+29 -11)📝
src/core/glm_prefill.cu(+268 -11)📄 Description
Correctness: the threshold counts the tokens a request reads (2026-10-20)
The same correction as Strata's
STRATA_MTP_ROOM_MINfix (ce882077): an agent turn re-sends a long conversation and reuses almost all of it, and a room that costs a ~0.7 GB round trip each way must not be taken to read a few hundred tokens. In Maya's serving loopprefill()is already handed only the part of the prompt pastreuse(generate.cpp), so the value tested was already the read count and run-time behavior is unchanged; the commit makes that the documented contract -tokens_readin the header and the definition, the rationale at the call site, and the setting's row - instead of "a prompt of this many tokens". Commite5285d4on top of the rebased feature commit.Two pieces of VRAM belong to the decode and are never read while a prompt runs. With this flag set they leave for the length of the prompt and come back before the next token:
decode_dflashrefuses to run while it is lent, so nothing can draft against half a drafter.The freed bytes become prestage ring. On a split with
STRATA_GLM_PRESTAGEunset, the ring stops being capped at Strata's 160 experts and only the pool's lend bounds it: in the measured run CUDA2/CUDA3 (the parts that sat at the cap) went to 439 and 303 experts, where the two 8 GB parts were already lend-bound at 127 and 90.Flag:
STRATA_GLM_ROOM_MIN- unset (the default) is the engine as it is today: the ring keeps its cap, nothing is unloaded, every layer's tail staysk_extra. Set to N, prompts of N tokens or more take the room;0= every prompt.STRATA_GLM_PRESTAGEstill caps the ring when it is set.Measured (4 parts: 2x RTX 3060 12 GB + 2x RTX 5060 8 GB,
--layer-split 10,21,33, 260k ctx,--prefill 16384,STRATA_GLM_ROOM_MIN=8192): the byte-identical 100,534-token read in 90,891 ms - 1,106 tok/s, 13 chunks of 7,744 - against the same rig's standing 89.5 s / 1,123 tok/s. A prompt chunk here is compute-bound, so what this buys is the ring and the phase booking, not seconds.docs/SETTINGS.mdcarries both rows. Builds clean;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.