[PR #224] docs: how to get the same tokens after a restart with the CPU lane on #404

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

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

State: closed
Merged: Yes


What

A "Repeatable answers" section in docs/SETTINGS.md (after "The expert pool's size"): why a greedy request does not return the same tokens after
a restart (or with another RAM tier) when the CPU lane is on, which settings pin that, and what it costs. Documentation only - no code, no new setting.

Why

With the CPU lane on, a RAM-tier expert is computed by the lane or by the GPU depending on where it sits, and the two paths round differently (GPU: q8_1 activations in blocks of 32;
ggml-cpu's dot: Q8_K in blocks of 256). I measured the lane at 1.7% relative L2 from a double-precision reference and the GPU kernels at 1.1% (150 real lane calls over 42 layers
of Maya-S-v2-IQ2_XXS), 1.9% from each other. The router's top-8 amplifies that: within a few tokens a quarter or more of the layers pick a different expert set, and greedy output parts
within tens of tokens. So the answer depends on which experts the lane gets, and that changes from one start to the next for reasons that are easy to miss.

What I measured (RTX 5090, 64 GB, Maya-S-v2-IQ2_XXS, 42 GB RAM tier, greedy, 6 prompts x 256 tokens + a warm-up, engine main @ 07c3dc9, interleaved engine starts)

settings starts pairs of token streams identical
defaults 5 17 of 70
--expert-cache 3250, STRATA_GLM_PROMOTE=0, STRATA_GLM_CPU_RETIME=0, STRATA_GLM_CPU_PLAN=001122333 5 70 of 70
the same, 300 MiB of VRAM held by another process 3 105 of 105 against the five above
the same, after 30 minutes idle 1 35 of 35
--expert-cache auto with the same 300 MiB held 3 0 of 105 against the five above
STRATA_GLM_CPU_LANE=0 5 70 of 70 (and identical for 26 and 42 GB)

Decode with the recipe: 18.31 tok/s (18.29-18.35) against 18.26 (17.80-18.48) with the defaults (medians of five). The cause is placement, not a race: with the same placement the
lane-on runs are bit-identical (logits and routes of 1762 of 1762 decoded positions, compared bitwise); what varies between starts is the VRAM pool (tiers warm: 9,453-9,488 experts in five starts:
--expert-cache auto takes whatever VRAM is free, and the "only N MiB free once the pool is written ... GB less" step trims it), the lane's start-up split (0.137 vs 0.141 ms per expert: a near tie, ... 3 3 3 or ... 3 3 4),
the split timed again in decode, and the background moves between tiers. Raw per-run files, scripts and the analysis: https://github.com/hiroki-abe-58/moe-tiering-lab/tree/main/results/phase4 (SUMMARY.md, exp13-determinism, exp14-recipe).

The section also says what it does not cover (one PC; DFlash2, MTP, several GPUs, Linux, AMD not tried) and that another pool, RAM tier, split, build or driver gives different, equally valid tokens.

Checks

  • Docs only. python tools/check_hip_compat.py passes (no code touched).
  • Duplicate search in issues and PRs for reproducible / deterministic / same tokens / bit-identical: nothing on this. Related: #56 (decode speed varying between restarts, with CPU-lane lines) - probably the same start-up split timing; I did not check that report's machine.
  • I also tried making the CPU lane's arithmetic match the GPU's (q8_1 activations, then the kernels' integer steps): the lane's relative distance to the GPU's expert falls from 1.9% to 0.06% (then 1e-7), but token streams still part because of rounding ties and the router, so I am not proposing it; details in the linked results.

🤖 Generated with Claude Code

https://claude.ai/code/session_012aHyspr6cyZfg2a8QG9Hqy

**Original Pull Request:** https://github.com/mw00/project-maya/pull/224 **State:** closed **Merged:** Yes --- ## What A "Repeatable answers" section in `docs/SETTINGS.md` (after "The expert pool's size"): why a greedy request does not return the same tokens after a restart (or with another RAM tier) when the CPU lane is on, which settings pin that, and what it costs. Documentation only - no code, no new setting. ## Why With the CPU lane on, a RAM-tier expert is computed by the lane or by the GPU depending on where it sits, and the two paths round differently (GPU: q8_1 activations in blocks of 32; ggml-cpu's dot: Q8_K in blocks of 256). I measured the lane at 1.7% relative L2 from a double-precision reference and the GPU kernels at 1.1% (150 real lane calls over 42 layers of Maya-S-v2-IQ2_XXS), 1.9% from each other. The router's top-8 amplifies that: within a few tokens a quarter or more of the layers pick a different expert set, and greedy output parts within tens of tokens. So the answer depends on *which experts the lane gets*, and that changes from one start to the next for reasons that are easy to miss. ## What I measured (RTX 5090, 64 GB, Maya-S-v2-IQ2_XXS, 42 GB RAM tier, greedy, 6 prompts x 256 tokens + a warm-up, engine `main` @ 07c3dc9, interleaved engine starts) | settings | starts | pairs of token streams identical | |---|---|---| | defaults | 5 | 17 of 70 | | `--expert-cache 3250`, `STRATA_GLM_PROMOTE=0`, `STRATA_GLM_CPU_RETIME=0`, `STRATA_GLM_CPU_PLAN=001122333` | 5 | 70 of 70 | | the same, 300 MiB of VRAM held by another process | 3 | 105 of 105 against the five above | | the same, after 30 minutes idle | 1 | 35 of 35 | | `--expert-cache auto` with the same 300 MiB held | 3 | 0 of 105 against the five above | | `STRATA_GLM_CPU_LANE=0` | 5 | 70 of 70 (and identical for 26 and 42 GB) | Decode with the recipe: 18.31 tok/s (18.29-18.35) against 18.26 (17.80-18.48) with the defaults (medians of five). The cause is placement, not a race: with the same placement the lane-on runs are bit-identical (logits and routes of 1762 of 1762 decoded positions, compared bitwise); what varies between starts is the VRAM pool (`tiers warm: 9,453-9,488 experts` in five starts: `--expert-cache auto` takes whatever VRAM is free, and the "only N MiB free once the pool is written ... GB less" step trims it), the lane's start-up split (0.137 vs 0.141 ms per expert: a near tie, `... 3 3 3` or `... 3 3 4`), the split timed again in decode, and the background moves between tiers. Raw per-run files, scripts and the analysis: https://github.com/hiroki-abe-58/moe-tiering-lab/tree/main/results/phase4 (`SUMMARY.md`, `exp13-determinism`, `exp14-recipe`). The section also says what it does not cover (one PC; DFlash2, MTP, several GPUs, Linux, AMD not tried) and that another pool, RAM tier, split, build or driver gives different, equally valid tokens. ## Checks * Docs only. `python tools/check_hip_compat.py` passes (no code touched). * Duplicate search in issues and PRs for reproducible / deterministic / same tokens / bit-identical: nothing on this. Related: #56 (decode speed varying between restarts, with CPU-lane lines) - probably the same start-up split timing; I did not check that report's machine. * I also tried making the CPU lane's arithmetic match the GPU's (q8_1 activations, then the kernels' integer steps): the lane's relative distance to the GPU's expert falls from 1.9% to 0.06% (then 1e-7), but token streams still part because of rounding ties and the router, so I am not proposing it; details in the linked results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012aHyspr6cyZfg2a8QG9Hqy
bsakaguchi 2026-10-29 21:25:04 +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#404
No description provided.