mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #352] [MERGED] GLM: a prompt's lending keeps the more recently used experts in RAM - 40% fewer disk reads after a fresh prompt #481
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#481
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/352
Author: @merbanan
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @mw00
Base:
main← Head:pr/lend-park-lru📝 Commits (1)
0397902GLM: a prompt's lending keeps the more recently used experts in RAM - 40% fewer disk reads after a fresh prompt📊 Changes
4 files changed (+44 additions, -15 deletions)
View changed files
📝
docs/SETTINGS.md(+1 -0)📝
src/core/glm_fast_path.cu(+9 -6)📝
src/core/glm_fast_state.hpp(+3 -2)📝
src/core/glm_prefill.cu(+31 -7)📄 Description
What
When a prompt borrows the expert pool's tail (
lend_range, about 450–600 experts on Maya-S24 on one V100), each expert that leaves VRAM is moved into the RAM tier. It goes over a RAM expert whose LFU count is strictly lower. A tail expert is likewise relocated over a main-slot expert only when that expert's count is strictly lower.The counts age: every 32,768 routing events halve them all. So most experts sit at the same small value, often 0. On a tie, the expert leaving VRAM went to disk, or the wrong RAM expert did. The answer that follows then reads it back from disk.
With this change, on equal counts the less recently used expert goes, and on equal recency the one with lower long-term usage goes. This applies both to the park and to the relocation.
STRATA_GLM_LEND_PARK_LRU=0(orMAYA_GLM_LEND_PARK_LRU=0) keeps the strict rule. Only where experts are placed changes, never which experts run. The new setting has a row in docs/SETTINGS.md.STRATA_GLM_TIER_DIAGalso gets a fifth disk-read cause, "lend-evicted": RAM experts the lending itself evicted. It now prints everySTRATA_GLM_TIER_DIAG_EVERYboundaries (default 64). That is how the cause was found.Measured
One Tesla V100-PCIE-32GB with a 7950X and 62 GB of RAM, GLM-5.3-Flash Maya-S24,
STRATA_GLM_PREFILL_SUB=1024. Same build (main v1.1.20 + this PR), two rounds each,STRATA_GLM_LEND_PARK_LRU=0vs the new default. Each run is one engine serving five requests in turn:Each request decodes 512 greedy tokens. The disk-read counts come from
STRATA_GLM_TIER_DIAG.After the fresh 24K prompt (the second time the run lends):
The cached requests are unchanged.
On our development branch, with the same harness over four rounds: 520–578 → 309–337 disk reads, and decode 30.8–32.5 → 32.9–33.4 tok/s.
Not fixed: the first prompt after a load still sends about 420 of the ~455 lent experts to disk, with either rule. At that point the RAM tier's counts are above those of the experts leaving VRAM. That happens once per server start.
Builds: native (sm_70).
tools/check_hip_compat.pypasses; there are no new CUDA calls.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.