[GH-ISSUE #51] Speed report + findings: 3090 + 3060 split, 5900X / DDR4 - the CPU plan under load, the split point, where the time goes #19

Closed
opened 2026-10-29 21:19:13 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @sociolog on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/51

Box: Ryzen 9 5900X, 128 GB DDR4-3200 (2 channels), RTX 3090 24 GB + RTX 3060 12 GB, both PCIe 4.0 x8, Maya-M,
--max-context 131072, STRATA_GLM_RAM_RESIDENT=1. Measured with --bench and a driver sending the same requests
plus one answer after a 20K-token context; the warm 21K API test over /v1/chat/completions at the end.

Start-up calibration: an expert 0.32 ms on the CPU vs 0.67 ms over PCIe -> 011233456. Under decode load the CPU lanes
and the devices' PCIe pulls read the same DDR4 at once; the fetch kernel's time per expert rises to ~1.0 ms
(STRATA_GLM_PROF: moe_fetch = 55 % of the 3090's stream time, 44 % of the 3060's). One more RAM-tier expert to
the CPU per route:

CPU plan decode
001223345 17.7
011233456 (calibrated) 19.6
011234567 20.0
012234567 (PCIe takes exactly one from f >= 3) 20.6
012334567 20.5
012345567 18.3
012345678 (all on the CPU) 17.8, and see the crash issue

With 012234567 fetches fell 45 -> 29 a token for only -1.5 points of VRAM hit. Suggestion: calibrate the two lanes
concurrently (both halves' CPU pools reading while the GPUs pull), or bias the table toward the CPU on 2-channel
desktop memory. Also: the calibration result varies run to run (011233456 vs 011234456), which moves experts between
CPU and GPU and makes STRATA_GLM_SCORE runs differ (KL ~0.02); pinning STRATA_GLM_CPU_PLAN and
STRATA_GLM_POOL_GB makes score mode bit-exact run to run - handy for exact-math changes.

2. The split point: more layers on the bigger card

26: 18.9 | 27: 19.4 | 28: 20.3 | 29: 21.3 | 30: 22.0 | 31: 21.8 | 32: 21.5 tok/s. The 3060's smaller pool per
layer makes each of its layers more expensive in off-card traffic, so total traffic, not the halves' balance,
decides. (Side note: serve/server.py's child_env lets a config's "env" override the process environment, so
STRATA_GLM_SPLIT=30 ./maya.sh --bench quietly benches the config's split.)

3. Measured, no gain here (for the record)

STRATA_GLM_PREFETCH_N 1 / 2: 17.1 / 16.6 (a loss, as the code says); 2 MB pages for the pinned tier (a microbench:
13.4 GB/s kernel pull and memcpy either way - the x8 link is the limit); lane threads 4 / 5 / 6 / 8 per half
20.1 / 21.7 / 22.2 / 20.9; uneven lanes 7/5, 5/7 worse; PROMOTE_MIN=3 noise; per-layer slots from
expert_counts.txt (the machine's usage) equal to uniform; enqueueing the two halves from two host threads: equal.
Batched multi-position decode would save only 6 % (2 positions) to 13 % (4) of the off-card expert loads here -
consecutive tokens rarely share their off-card experts - so on a RAM-bound box it does not pay.

4. Result

Everything together (the indexer ring #45, INT8 latents #46, MTP_KEEP #48 and a 3060-only dense q5_k #49), the warm
21K API test: decode at 21K 17.97 -> 20.71 t/s, at 63K 17.74 -> 20.33 t/s, prefill unchanged (779 / 776);
KL 0.024 against v1.0.15 (the CPU-vs-GPU arithmetic floor is ~0.02).


The tests, the measurements and this report were produced with the help of Claude, an AI assistant by Anthropic.

Originally created by @sociolog on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/51 Box: Ryzen 9 5900X, 128 GB DDR4-3200 (2 channels), RTX 3090 24 GB + RTX 3060 12 GB, both PCIe 4.0 x8, Maya-M, `--max-context 131072`, `STRATA_GLM_RAM_RESIDENT=1`. Measured with `--bench` and a driver sending the same requests plus one answer after a 20K-token context; the warm 21K API test over `/v1/chat/completions` at the end. ## 1. The CPU-lane plan, calibrated idle, gives the PCIe link too much under load Start-up calibration: an expert 0.32 ms on the CPU vs 0.67 ms over PCIe -> 011233456. Under decode load the CPU lanes and the devices' PCIe pulls read the same DDR4 at once; the fetch kernel's time per expert rises to ~1.0 ms (`STRATA_GLM_PROF`: `moe_fetch` = 55 % of the 3090's stream time, 44 % of the 3060's). One more RAM-tier expert to the CPU per route: | CPU plan | decode | |---|---:| | 001223345 | 17.7 | | 011233456 (calibrated) | 19.6 | | 011234567 | 20.0 | | **012234567** (PCIe takes exactly one from f >= 3) | **20.6** | | 012334567 | 20.5 | | 012345567 | 18.3 | | 012345678 (all on the CPU) | 17.8, and see the crash issue | With 012234567 fetches fell 45 -> 29 a token for only -1.5 points of VRAM hit. Suggestion: calibrate the two lanes concurrently (both halves' CPU pools reading while the GPUs pull), or bias the table toward the CPU on 2-channel desktop memory. Also: the calibration result varies run to run (011233456 vs 011234456), which moves experts between CPU and GPU and makes `STRATA_GLM_SCORE` runs differ (KL ~0.02); pinning `STRATA_GLM_CPU_PLAN` and `STRATA_GLM_POOL_GB` makes score mode bit-exact run to run - handy for exact-math changes. ## 2. The split point: more layers on the bigger card 26: 18.9 | 27: 19.4 | 28: 20.3 | 29: 21.3 | **30: 22.0** | 31: 21.8 | 32: 21.5 tok/s. The 3060's smaller pool per layer makes each of its layers more expensive in off-card traffic, so total traffic, not the halves' balance, decides. (Side note: `serve/server.py`'s `child_env` lets a config's `"env"` override the process environment, so `STRATA_GLM_SPLIT=30 ./maya.sh --bench` quietly benches the config's split.) ## 3. Measured, no gain here (for the record) `STRATA_GLM_PREFETCH_N` 1 / 2: 17.1 / 16.6 (a loss, as the code says); 2 MB pages for the pinned tier (a microbench: 13.4 GB/s kernel pull and memcpy either way - the x8 link is the limit); lane threads 4 / 5 / 6 / 8 per half 20.1 / 21.7 / 22.2 / 20.9; uneven lanes 7/5, 5/7 worse; `PROMOTE_MIN=3` noise; per-layer slots from `expert_counts.txt` (the machine's usage) equal to uniform; enqueueing the two halves from two host threads: equal. Batched multi-position decode would save only 6 % (2 positions) to 13 % (4) of the off-card expert loads here - consecutive tokens rarely share their off-card experts - so on a RAM-bound box it does not pay. ## 4. Result Everything together (the indexer ring #45, INT8 latents #46, MTP_KEEP #48 and a 3060-only dense q5_k #49), the warm 21K API test: decode at 21K **17.97 -> 20.71 t/s**, at 63K **17.74 -> 20.33 t/s**, prefill unchanged (779 / 776); KL 0.024 against v1.0.15 (the CPU-vs-GPU arithmetic floor is ~0.02). --- *The tests, the measurements and this report were produced with the help of Claude, an AI assistant by Anthropic.*
Author
Owner

@sociolog commented on GitHub (Oct 9, 2026):

Note: the indexer ring and the INT8 latent cache measured above arrived upstream via #41 (STRATA_GLM_KV_INT8=1), merged in v1.0.21; our #45 / #46 are closed as superseded. STRATA_GLM_MTP_KEEP (#48) and the dense requant (#49) remain open.

<!-- gh-comment-id:6080744475 --> @sociolog commented on GitHub (Oct 9, 2026): Note: the indexer ring and the INT8 latent cache measured above arrived upstream via #41 (`STRATA_GLM_KV_INT8=1`), merged in v1.0.21; our #45 / #46 are closed as superseded. `STRATA_GLM_MTP_KEEP` (#48) and the dense requant (#49) remain open.
Author
Owner

@sociolog commented on GitHub (Oct 9, 2026):

Update: STRATA_GLM_MTP_KEEP (#48) was merged in v1.0.24 (default 2); the dense requant (#49) is withdrawn - it went below the pack's precision floors. On v1.0.24 with STRATA_GLM_KV_INT8=1, split 30 and CPU plan 012234567 this box runs ~20.8 tok/s decode.

Produced with the help of Claude, an AI assistant by Anthropic.

<!-- gh-comment-id:6084579081 --> @sociolog commented on GitHub (Oct 9, 2026): Update: `STRATA_GLM_MTP_KEEP` (#48) was merged in v1.0.24 (default 2); the dense requant (#49) is withdrawn - it went below the pack's precision floors. On v1.0.24 with `STRATA_GLM_KV_INT8=1`, split 30 and CPU plan 012234567 this box runs ~20.8 tok/s decode. *Produced with the help of Claude, an AI assistant by Anthropic.*
Author
Owner

@mw00 commented on GitHub (Oct 11, 2026):

Thank you for the follow-up: STRATA_GLM_MTP_KEEP (#48) shipped, and ~20.8 tok/s on the 3090 + 3060 is noted. Closing this one as done; your later threads (#77, #79) carry on.

<!-- gh-comment-id:6104670268 --> @mw00 commented on GitHub (Oct 11, 2026): Thank you for the follow-up: `STRATA_GLM_MTP_KEEP` (#48) shipped, and ~20.8 tok/s on the 3090 + 3060 is noted. Closing this one as done; your later threads (#77, #79) carry on.
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#19
No description provided.