mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #88] [MERGED] The expert profile as Strata has it, for GLM packs (9 GPUs, a fresh start: decode 35.4 -> 40.7 tok/s); learning across starts is opt-in #326
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#326
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/88
Author: @needmorevram
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @mw00
Base:
main← Head:glm-expert-profile📝 Commits (2)
5070ebaThe expert profile as Strata has it, for GLM packs: --expert-profile decides each layer's VRAM slots and what a start loads first, --expert-profile-save learns across starts when asked; the usage file is opt-in (9 GPUs, a fresh start: decode 35.4 -> 40.7 tok/s)342fc04The draft layer keeps at least the per-layer equal share of its card's slots, whatever the expert profile ranks it📊 Changes
20 files changed (+959 additions, -103 deletions)
View changed files
📝
CMakeLists.txt(+11 -0)➕
data/expert-profile-glm.bin(+0 -0)📝
docs/SETTINGS.md(+28 -7)📝
include/strata/core/expert_cache.hpp(+19 -0)📝
include/strata/core/glm_model.hpp(+18 -1)📝
maya.py(+41 -1)📝
src/core/expert_cache.cpp(+87 -2)📝
src/core/glm_fast_path.cu(+113 -19)📝
src/core/glm_fast_state.hpp(+10 -0)📝
src/core/glm_model.cu(+6 -6)📝
src/core/glm_prefill.cu(+8 -0)📝
src/program/generate.cpp(+38 -1)➕
tests/core/expert_profile_save_test.cpp(+80 -0)➕
tests/core/expert_profile_version_test.cpp(+73 -0)📝
tools/calibrate_glm.py(+29 -14)📝
tools/glm_expert_prior.py(+5 -4)📝
tools/make_profile.py(+120 -36)📝
tools/test_calibrate_glm.py(+17 -12)➕
tools/test_make_profile.py(+145 -0)➕
tools/test_maya_profile.py(+111 -0)📄 Description
Summary
GLM packs get Strata's expert profile, the way Strata's own setup uses it:
--expert-profile FILEdecides which experts a start puts in VRAM and how many VRAM slots each layer gets. Setup passes the shippeddata/expert-profile-glm.binto every config.--expert-profile-save FILEsaves what the expert tiers learned.STRATA_GLM_USAGE(the usage file read at start and written after every request) no longer has a default.On 9 GPUs a fresh start decodes 35.4 -> 40.7 tok/s (no profile -> this one). On one RTX 3090 the new profile ties the earlier one.
What changes
Engine (
--glm-pack)--expert-profile FILEexpert_counts.txt/expert_prior.txt; without a profile the engine reads those as before.--expert-profile-save FILE--expert-profile-save-every MINminutes (default 10) between requests and at QUIT, through a.tmpand a rename.--dump-routing FILESTRATA_GLM_USAGEis opt-in: unset (or0), no usage file is read or written. The split search reads the same setting.STRATA_GLM_USAGE=<pack>/expert_usage.txtgives the old behaviour back.read_expert_profilenow refuses a profile version other than 1 by its number.rank_learned_profileandwrite_expert_profileare added for the save.Setup (
maya.py)--expert-profile data/expert-profile-glm.bin.--expert-profile-saveand--expert-profile-save-everyare kept too.--expert-profiletherefore gets the shipped one at its next start and is saved back once (starts from the shipped expert profile now). An update needs nothing else.Calibration (
tools/calibrate_glm.py)--expert-profile-save/--dump-routing, so tuning prompts never reach a learned profile or a trace.STRATA_GLM_USAGE.Tools
tools/make_profile.py --glm: 46 x 288 layout. It reads--dump-routingtraces and the engine's text records (usage files,expert_counts.txt,STRATA_GLM_TRACElines).--reorder: traces before the base.--equal: each input scaled to one total.The shipped profile
tools/make_profile.py --glm --no-baseover one--dump-routingtrace:Benchmarks
Setup: Maya-L (156 GB), 2x Xeon Gold 6152 (88 vCPUs), 177 GB RAM.
Method:
9 GPUs (RTX 3090 + 8x RTX 5060 Ti, 64K context, MTP on)
expert_usage.txt(today's default, throughSTRATA_GLM_USAGE)One RTX 3090 (32K context, rebased build)
On one GPU the two profiles tie: a 3090 holds 1,340 of Maya-L's 12,096 routed experts, and both profiles rank those first about equally well.
Without a GPU: the share of routes a start's VRAM serves
Held-out estimate: a profile built from one half of the trace, scored on the other half's routes, at the VRAM budget of each card. This is static: it ignores the live tier's promotions. The range covers both directions.
Tests
tests/core/expert_profile_save_test:rank_learned_profile's order andwrite_expert_profile's file, read back.tests/core/expert_profile_version_test: a version other than 1 is refused.tools/test_make_profile.py, including--glmand the text records.tools/test_maya_profile.py: the shipped profile in a new config, a hand-wired profile and--expert-profile-savekept by a later setup, an older config gaining the profile at its next start.tools/test_calibrate_glm.py: the usage copy only when opted in; the calibration's engine without the arguments that write files.tools/(201 tests) andserve/(130) pass; CUDA build for sm_86 + sm_120.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.