mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #91] [MERGED] tools/glm_tier_replay.py: replay STRATA_GLM_ROUTE_LOG traces through a model of the GLM VRAM expert tier (the engine's rules and alternatives), with tests #329
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#329
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/91
Author: @sociolog
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @mw00
Base:
main← Head:pr-tier-replay📝 Commits (1)
5ab8992tools/glm_tier_replay.py: replay STRATA_GLM_ROUTE_LOG traces through a model of the GLM VRAM expert tier (the engine's rules and alternatives), with tests📊 Changes
2 files changed (+384 additions, -0 deletions)
View changed files
➕
tools/glm_tier_replay.py(+289 -0)➕
tools/test_glm_tier_replay.py(+95 -0)📄 Description
What
As offered on #79: the replay behind that study, cleaned up as a tool -
tools/glm_tier_replay.pyand its tests.It models the fast path's VRAM tier as the engine runs it - per-layer residents + 3 spares seeded from the pack's
expert_usage.txt, aged counts halved every 4096 routes, the CPU lane's plan taking the coldest misses, PCIe fetchespromoted into free spares, the token-boundary refill evicting the lowest aged count, the draft's
MTP_KEEP- andreplays a route log through it with the engine's policy or an alternative (LRU, segmented LRU, protect-recent, reuse
distance, near-miss-weighted counts, near-miss recency), with Belady (hindsight) as the ceiling. "live" is the hit
rate the trace's own masks show, so a replay validates itself: on a Maya-M trace (RTX 3090 + 3060, split 30, 76 / 51
slots a layer, plan
012234567) the engine's policy gives 65.1 / 60.2 % against the live 65.4 / 61.5 %.The docstring says how to record a trace (
STRATA_GLM_ROUTE_LOG=<prefix>, the usage file of the run, the slot countsand the plan from the engine's log) and what the model leaves out: time is a per-route max of CPU-lane and PCIe counts
with no overlap between layers or devices and no prompt reads; the RAM tier and the disk are one level; the
prefetch's copies are not modelled (trace with
STRATA_GLM_PREFETCH_Nunset to validate).It reads route lines with or without the near-miss columns of #90.
tools/glm_cache_sim.pystays as it is: thedesign-phase LFU-pool simulator over its own trace format.
Checks
tools/test_glm_tier_replay.py, 7 tests (parsing with and without near misses, token counting, the most-usedexperts staying resident, the plan sending misses to the CPU lane, spares under LRU against the engine's rule, the
draft layer outside the hit rate, the command line):
python -m unittest discover -s tools -p test_glm_tier_replay.pyOK;🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.