[PR #228] GLM decode: leave out light misses by weight (STRATA_GLM_MISS_SKIP_W / _FROM, off by default, changes the answers) #408

Closed
opened 2026-10-29 21:25:06 +07:00 by bsakaguchi · 0 comments
Owner

Original Pull Request: https://github.com/mw00/project-maya/pull/228

State: closed
Merged: Yes


What

TRUNK_KEEP leaves out the experts missing from VRAM from a route rank on. This does the same by weight: a routed expert that is not in VRAM and carries less than STRATA_GLM_MISS_SKIP_W of the route's weights is left out (no PCIe fetch, no CPU-lane work), on layers from STRATA_GLM_MISS_SKIP_FROM on. It is the rule STRATA_GLM_DISK_SKIP_W already applies to disk-only experts, applied to RAM-tier misses.

A token routed to one or two strong experts drops more of its light misses than one spread evenly. Off by default (0): nothing changes.

  • moe_route_kernel: the skip test, and the CPU lane's RAM-tier set leaves those experts out.
  • The bar and first layer are read at start (one log line when on).
  • A request may set its own through strata_tune ({"miss_skip_w": 0.14, "miss_skip_from": 23}, 0 = off for it) - server, generate loop, Glm5Model::set_miss_skip - so a model / PC can be swept without a restart, as pcie_frac. A server test covers the keys.
  • A row in docs/SETTINGS.md.

Quality and speed

RTX 3090 alone, Ryzen 7 9700X, DDR5-3600, Windows 11. KL to the untrimmed model is from STRATA_GLM_SCORE (1,746 tokens of English docs, Japanese, Python, a word problem, STRATA_GLM_PCIE_SHARE fixed so the runs are deterministic; the same run twice gives KL 0). Speed is the full benchmark suite (chat / agent decode tok/s, medians).

model setting chat agent KL same top token
Maya-S24 TRUNK_KEEP_MAP stage 4 (...55555554444...) 27.4 27.3 0.027 92.4%
MISS_SKIP_W 0.12, FROM 23 29.3 27.7 0.037 91.2%
0.14, FROM 23 30.1 29.0 0.052 89.6%
0.16, FROM 23 30.9 29.6 0.075 88.0%
TRUNK_KEEP_MAP (...6666666644444443333...), same KL as 0.16 29.7 28.8 0.076 87.7%
Maya-M TRUNK_KEEP_MAP stage 4 19.9 18.1 0.038 90.1%
0.12, FROM 23 21.3 19.5 0.047 89.2%
0.14, FROM 23 21.8 21.0 0.060 88.7%

Prompt speed is unchanged. On every layer the trade is poor: GLM-5.3's early layers notice a left-out expert far more than its late ones (0.04 on all layers: KL 0.041 for about 1% speed). Hence the first-layer setting.

Tested here / not tested

  • One GPU only (a split's parts each read the same settings - not run here).
  • MSVC on Windows only; no new CUDA names (check_hip_compat passes); the server test added passes, and the other Python tests show only the Windows-only errors unmodified main shows here.
**Original Pull Request:** https://github.com/mw00/project-maya/pull/228 **State:** closed **Merged:** Yes --- ### What `TRUNK_KEEP` leaves out the experts missing from VRAM from a route rank on. This does the same by **weight**: a routed expert that is not in VRAM and carries less than `STRATA_GLM_MISS_SKIP_W` of the route's weights is left out (no PCIe fetch, no CPU-lane work), on layers from `STRATA_GLM_MISS_SKIP_FROM` on. It is the rule `STRATA_GLM_DISK_SKIP_W` already applies to disk-only experts, applied to RAM-tier misses. A token routed to one or two strong experts drops more of its light misses than one spread evenly. Off by default (0): nothing changes. - `moe_route_kernel`: the skip test, and the CPU lane's RAM-tier set leaves those experts out. - The bar and first layer are read at start (one log line when on). - A request may set its own through `strata_tune` (`{"miss_skip_w": 0.14, "miss_skip_from": 23}`, 0 = off for it) - server, generate loop, `Glm5Model::set_miss_skip` - so a model / PC can be swept without a restart, as `pcie_frac`. A server test covers the keys. - A row in `docs/SETTINGS.md`. ### Quality and speed RTX 3090 alone, Ryzen 7 9700X, DDR5-3600, Windows 11. KL to the untrimmed model is from `STRATA_GLM_SCORE` (1,746 tokens of English docs, Japanese, Python, a word problem, `STRATA_GLM_PCIE_SHARE` fixed so the runs are deterministic; the same run twice gives KL 0). Speed is the full benchmark suite (chat / agent decode tok/s, medians). | model | setting | chat | agent | KL | same top token | |---|---|---:|---:|---:|---:| | Maya-S24 | TRUNK_KEEP_MAP stage 4 (`...55555554444...`) | 27.4 | 27.3 | 0.027 | 92.4% | | | MISS_SKIP_W 0.12, FROM 23 | 29.3 | 27.7 | 0.037 | 91.2% | | | 0.14, FROM 23 | 30.1 | 29.0 | 0.052 | 89.6% | | | 0.16, FROM 23 | 30.9 | 29.6 | 0.075 | 88.0% | | | TRUNK_KEEP_MAP (`...6666666644444443333...`), same KL as 0.16 | 29.7 | 28.8 | 0.076 | 87.7% | | Maya-M | TRUNK_KEEP_MAP stage 4 | 19.9 | 18.1 | 0.038 | 90.1% | | | 0.12, FROM 23 | 21.3 | 19.5 | 0.047 | 89.2% | | | 0.14, FROM 23 | 21.8 | 21.0 | 0.060 | 88.7% | Prompt speed is unchanged. On every layer the trade is poor: GLM-5.3's early layers notice a left-out expert far more than its late ones (0.04 on all layers: KL 0.041 for about 1% speed). Hence the first-layer setting. ### Tested here / not tested - One GPU only (a split's parts each read the same settings - not run here). - MSVC on Windows only; no new CUDA names (`check_hip_compat` passes); the server test added passes, and the other Python tests show only the Windows-only errors unmodified `main` shows here.
bsakaguchi 2026-10-29 21:25:06 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#408
No description provided.