mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #78] [MERGED] GLM VRAM tier: STRATA_GLM_VRAM_EVICT=lru - refill a layer's spares by evicting its least recently used expert (opt-in) #318
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#318
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/78
Author: @sociolog
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @mw00
Base:
main← Head:pr-vram-lru📝 Commits (1)
3791f7eGLM VRAM tier: STRATA_GLM_VRAM_EVICT=lru - the spare refill evicts the least recently used resident instead of the least-used by the aged counts (opt-in)📊 Changes
2 files changed (+10 additions, -2 deletions)
View changed files
📝
README.md(+1 -0)📝
src/core/glm_fast_path.cu(+9 -2)📄 Description
What
fast_boundaryrefills each layer's spares by evicting the layer's least-used resident by the aged counts (recencybreaks ties). With
STRATA_GLM_VRAM_EVICT=lruit evicts the least recently used resident instead. One switch, readonce; the default path is untouched. README row added.
Why
The aged counts halve every 4096 routes, so a resident that was frequent a while ago outlives one that is in use now;
a freshly promoted expert (cold, or it would not have been in RAM) has a low count and is often the next one evicted.
How much that matters depends on how many misses are promoted - i.e. fetched over PCIe rather than computed by the
CPU lane.
Measured on Ryzen 9 5900X + 128 GB DDR4, RTX 3090 + 3060 (both x8), v1.0.30 with this patch, warm 21K API test
(fresh 21K prompt, then 2,500 tokens at 21K depth); the test's prompts gave identical answers run to run, so the
baseline's tier numbers repeated exactly:
RAM_GB=96(+ NVMe tier), calibrated plan, default evictionSTRATA_GLM_VRAM_EVICT=lruRAM_RESIDENT=1,CPU_PLAN=012234567(at most one PCIe fetch a route), defaultlruSo: +2.6 % decode where the plan promotes (Maya-L's calibrated plan here), no change where it hardly does. Route
traces replayed through a model of these rules (details and the bounds in a separate issue) agree: LRU gains most on
the half with the smaller pool and with plans that fetch more over PCIe.
Checks run on this branch: builds (sm_75, sm_86);
glm_dsa_parity,glm_ffn_parity,glm_hc_parity,glm_kda_parity,glm_layer_parity--selftest: all PASS;python -m unittest serve.test_server serve.test_tools serve.test_mcp serve.test_detok: OK; the 21K API test above with the switch on and off on the real model.The code, the measurements and this description were produced with the help of Claude, an AI assistant by Anthropic.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.