[GH-ISSUE #548] maya-mm3: one slow CPU-lane probe at load stages every expert for the session (~21% slower decode), and can flip the DSpark speed calibration #223

Closed
opened 2026-10-29 21:22:52 +07:00 by bsakaguchi · 2 comments
Owner

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

Version: v1.1.30, maya-mm3, MiniMax-M3.1-Flash-Maya-S (GGUF, layer split), DSpark on. We run it in club-3090's MiniMax slugs: a Linux image built from the v1.1.30 tag.

PC: 1× or 2× RTX 3090 (24 GB, driver 610.57.04), a VM with 32 vCPUs of an EPYC 7543, 224 GB RAM. CPU lane 25 threads.

What happened

At load, calibrate_lane() (src/mm3/mm3_model.cu) times the CPU lane against a staging copy once and keeps the split for the whole session. On one start it misread:

CPU lane vs staging (measured): an expert 3.98 ms on the CPU lane (+0.00 ms each more), 0.88 ms to copy - 4 such experts: 4 staged

The same config on the same card normally reads:

CPU lane vs staging (measured): an expert 0.31 ms on the CPU lane (+0.16 ms each more), 0.56 ms to copy - 4 such experts: 1 staged

Every other start we have logged, on one card and on two, read 0.25–0.35 ms for one expert and 1 staged. The other two numbers vary more: one single-card start read +0.94 ms each more, 1.05 ms to copy and still chose 1 staged.

With 4 staged, that session decoded at 13.9 tok/s instead of 17.7, about 21% slower, for as long as it ran.

Where it bites: the speed calibration

The bad start was the DSpark side of tools/calibrate_ds4.py on one card. It was the second engine start of that run, right after the first engine (with about 100 GB pinned) had exited.

Run Without drafting DSpark Verdict
1 (the DSpark start misread) 15.89 tok/s 13.94 (answers 13.3 / 13.2 / 15.5) none, gain −0.123
2 (both starts read normally) 16.0 17.69 dspark, gain +0.106

So one misread can switch the drafter off for a PC whose setup runs the speed calibration on first start.

Why we think it's the probe, not the PC

lane_cpu_add = max(0, (t4 - lane_cpu1) / 3) came out 0.00. So the single four-expert call took no longer than the median of the one-expert calls, which means the one-expert samples were inflated. The copy was slow in the same probe too (0.88 against 0.56 ms). Something else on the PC held the CPU and the bus for that moment, plausibly the previous engine's pinned memory still being released. A single sample then fixed lane_split(4) for the session.

Suggestions

These are ideas; you know the trade-offs better.

  • Treat an inconsistent probe as a failed one and measure again: four experts no slower than one, i.e. lane_cpu_add clamped to 0.
  • Warm the lane before timing (one untimed lane_run), and take the best of a few rounds.
  • Re-check the split after the first answer, when the PC is quiet.
  • Log a warning when the split stages every expert. Today it is visible only in the start line.

Workaround meanwhile: restart when the start line says anything but 1 staged. We haven't measured whether MM3_LANE_SPLIT=0 (no split at all) costs anything against the normal 1 staged.

Originally created by @noonghunna on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/548 **Version:** v1.1.30, `maya-mm3`, MiniMax-M3.1-Flash-Maya-S (GGUF, layer split), DSpark on. We run it in [club-3090](https://github.com/noonghunna/club-3090)'s MiniMax slugs: a Linux image built from the v1.1.30 tag. **PC:** 1× or 2× RTX 3090 (24 GB, driver 610.57.04), a VM with 32 vCPUs of an EPYC 7543, 224 GB RAM. CPU lane 25 threads. ## What happened At load, `calibrate_lane()` (`src/mm3/mm3_model.cu`) times the CPU lane against a staging copy once and keeps the split for the whole session. On one start it misread: ``` CPU lane vs staging (measured): an expert 3.98 ms on the CPU lane (+0.00 ms each more), 0.88 ms to copy - 4 such experts: 4 staged ``` The same config on the same card normally reads: ``` CPU lane vs staging (measured): an expert 0.31 ms on the CPU lane (+0.16 ms each more), 0.56 ms to copy - 4 such experts: 1 staged ``` Every other start we have logged, on one card and on two, read 0.25–0.35 ms for one expert and `1 staged`. The other two numbers vary more: one single-card start read `+0.94 ms each more, 1.05 ms to copy` and still chose `1 staged`. With `4 staged`, that session decoded at **13.9 tok/s instead of 17.7**, about 21% slower, for as long as it ran. ## Where it bites: the speed calibration The bad start was the DSpark side of `tools/calibrate_ds4.py` on one card. It was the second engine start of that run, right after the first engine (with about 100 GB pinned) had exited. | Run | Without drafting | DSpark | Verdict | |---|---|---|---| | 1 (the DSpark start misread) | 15.89 tok/s | 13.94 (answers 13.3 / 13.2 / 15.5) | `none`, gain −0.123 | | 2 (both starts read normally) | 16.0 | 17.69 | `dspark`, gain +0.106 | So one misread can switch the drafter off for a PC whose setup runs the speed calibration on first start. ## Why we think it's the probe, not the PC `lane_cpu_add = max(0, (t4 - lane_cpu1) / 3)` came out 0.00. So the single four-expert call took no longer than the median of the one-expert calls, which means the one-expert samples were inflated. The copy was slow in the same probe too (0.88 against 0.56 ms). Something else on the PC held the CPU and the bus for that moment, plausibly the previous engine's pinned memory still being released. A single sample then fixed `lane_split(4)` for the session. ## Suggestions These are ideas; you know the trade-offs better. - **Treat an inconsistent probe as a failed one and measure again:** four experts no slower than one, i.e. `lane_cpu_add` clamped to 0. - **Warm the lane before timing** (one untimed `lane_run`), and take the best of a few rounds. - **Re-check the split after the first answer**, when the PC is quiet. - **Log a warning when the split stages every expert.** Today it is visible only in the start line. Workaround meanwhile: restart when the start line says anything but `1 staged`. We haven't measured whether `MM3_LANE_SPLIT=0` (no split at all) costs anything against the normal `1 staged`.
Author
Owner

@talisp commented on GitHub (Oct 27, 2026):

We see the same thing on a very different box, and more often: 4 of the 14 MiniMax starts that ran the probe today misread it, and the worst one held decode at ~6.5 tok/s for the whole session, against 14-17 on a good start. Our misreads go the other way from yours, though. Yours read +0.00 ms each more. Ours read +1.27, +1.29, +1.36 and once +11.67 ms each more, against 0.25-0.33 on good starts. So the consistency check you suggest (four experts no slower than one) would catch yours but not ours. A bound in the other direction would be needed too, or several rounds with the best one kept.

The case where it hurt most: a start while ~550 GB of downloads had filled the page cache. 2 GB of RAM was free, kcompactd0 sat at 100% of a core, and the previous engine (DeepSeek, 271 GB of host memory) had just exited. The probe read 0.88 ms (+11.67 ms each more) ... 3 staged. For the whole session the CPU lane's 28 threads sat at ~30% each, waiting on staging copies, and the 3D tasks decoded at 6.3-6.7 tok/s. Other misreads came right after a previous maya-mm3 had exited, which fits your reading. But good starts came right after an exit too, so it isn't only that.

What we found answers your open question: MM3_LANE_SPLIT=0 isn't a safe workaround here. It cost ~11% of decode against a normal 1 staged start (15.0 / 15.3 against 16.7 / 17.3 tok/s, two runs each). The split pays off when it reads right. What has worked for us is your other workaround: restart until the start line says 0 or 1 staged. The one restart we needed today read normal on the next try. The other two engines already re-plan in decode: maya-ds4 times the CPU lane again (the CPU lane timed again in decode), and GLM's fast path has lane_retime (re-plans when the CPU's cost drifts >15%). Doing the same in maya-mm3 would make a bad start harmless, whatever the PC is doing at that moment. The data follows.


Machine and config

  • GPU: 1× NVIDIA L40S-48Q (vGPU, the whole 48 GB card).
  • CPU and RAM: Xeon Platinum 8580 VM, 32 vCPUs without SMT, 1 NUMA node seen; ~504 GB RAM; Linux 6.8.
  • Model: MiniMax-M3.1-Flash, Mia-AiLab's EXL3 3.55 bpw. 767 experts resident with --chunk 8192 (961 with the default chunk); the pinned pool holds every other expert (~167 GB pinned).
  • Maya: v1.1.30 and v1.1.32 (no change to calibrate_lane() between them; v1.1.33 only fixes the setup's pack step).
  • Benchmark:
    • through the server, temperature 0, reasoning_effort: low;
    • the numbers are the server's own timings;
    • "quick" = an 8K-token read + 3 code prompts of 600 tokens; "speed" = 6 code prompts + reads of 8K / 32K / 128K.

Every start we logged today

Times are local; "after" = what ran just before.

# Version / config Start line (CPU lane vs staging (measured): ...) Staged of 4 Decode that session
1 v1.1.30, setup defaults (32 threads, chunk 1024, DSpark) 0.37 ms (+0.75 ms each more), 1.14 ms to copy 1 13.0 (quick)
2 v1.1.30, --cpu-threads 29, DSpark on 0.37 ms (+0.30), 2.35 ms to copy 0 14.7 (quick)
3 v1.1.30, --cpu-threads 29, DSpark off 0.42 ms (+0.26), 1.14 0 12.4 (quick)
4 v1.1.30, --cpu-threads 27, DSpark on 0.39 ms (+0.33), 1.14 1 15.8 (quick)
5 v1.1.30, --cpu-threads 27, DSpark off, after #4's engine exited 0.47 ms (+1.29), 1.16 2 9.3 (quick), vs 12.4 at #3
6 v1.1.30, --cpu-threads 27 --chunk 8192, DSpark 0.86 ms (+0.60), 1.14 1 14.4 (speed)
7 v1.1.30, the same with --chunk 16384 (541 resident), after #6's engine exited 0.38 ms (+1.27), 1.17 2 10.0 (quick; confounded with fewer resident experts)
8 v1.1.30, as #6, after DeepSeek exited, downloads filling the page cache (2 GB free, kcompactd0 100%) 0.88 ms (+11.67), 1.15 3 6.3-6.7 (3D tasks, the whole session)
9 v1.1.32, as #6, page cache relieved first (495 GB available) 0.37 ms (+0.29), 1.14 0 16.7 (speed); 3D at ~18
10 v1.1.32, as #6 0.48 ms (+0.28), 1.14 1 16.7 / 17.3 (quick ×2)
11 v1.1.32, as #6 + MM3_LANE_SPLIT=0 (no line: no split) - 15.0 / 15.3 (quick ×2)
12 v1.1.32, as #6 + --no-pin-pool (no line: no pool) - 14.4 / 14.6 (quick ×2)
13 v1.1.32, as #6, after #12's engine exited 0.50 ms (+1.36), 1.14 2 (restarted)
14 v1.1.32, the restart of #13 0.55 ms (+0.27), 1.14 1 (normal)
15 v1.1.32 local build (a page-cache test, same engine code otherwise), as #6 0.72 ms (+0.30), 1.14 1 (normal)
16 v1.1.32, Maya-S GGUF instead of EXL3 0.30 ms (+0.25), 0.59 ms to copy 1 (being measured)

On v1.1.29 we had seen one more: 0.44 ms (+1.27 ms each more), 2 of 4 staged, with --cpu-threads 30. That session staged 17,133 experts, routing waits rose to 60.7 ms a token (MM3_TIMING=1), and decode ran at 9.6 tok/s against 12.8 at --cpu-threads 28.

What the misreads have in common:

  • The one-expert time is close to normal (0.38-0.50 ms; 0.88 in #8). The "each more" figure is 4-45x its usual 0.25-0.33 ms.
  • The copy time stays at 1.14-1.17 ms every time (2.35 once, at #2, which still chose 0).
  • So in our cases the four-expert call is the inflated sample, not the one-expert ones. The split then stages 2-3 of 4 experts over PCIe, when here the right answer is 0-1.

Session #8, the worst one

  • Memory: free -g showed 503 total, 9 used, 2 free, 491 buff/cache, 322 available. kcompactd0 was at 100% of a core.
  • CPU: the engine was at ~840% CPU for 28 lane threads, i.e. ~30% each, waiting on staging copies (~1.15 ms each, serial per token).
  • Decode: the 3D tasks ran at 6.3 / 6.6 / 6.7 / 6.7 / 6.6 tok/s, and the thinking at 5.6.
  • What we changed: we stopped it, moved our downloads into a cgroup with MemoryHigh so their page cache can't fill the RAM, and dropped the cache of the model files not in use (posix_fadvise(DONTNEED)). Start #9 then read normally and decoded at 16.7 tok/s.

MM3_LANE_SPLIT=0 against a normal split (v1.1.32, same config, quick ×2)

Decode Prefill 8K
normal start, 1 staged 16.7 / 17.3 404 / 412
MM3_LANE_SPLIT=0 15.0 / 15.3 408 / 414
  • Niko1221/Strata#485 (closed): the start-up PCIe probe read the same link at 18.5, 6.9 and 5.8 GB/s across starts. Strata 0.1.37 fixed it by timing four bursts and taking the fastest, since "a disturbance only slows a copy". The same holds for a CPU-lane timing: a busy PC can only make the four-expert call slower, so the best of a few rounds is the honest one.
  • Niko1221/Strata#4007: a start-up-only PCIe share against the runtime refinement (PcieAuto). Refining in decode gave 42-44 against 35-37 tok/s on the same card.
  • #56 here (GLM, Windows, two NUMA nodes): decode varied ~30% between restarts. A different cause (the DMA path across nodes), but the same start-to-start lottery.

What we'd suggest, adding to yours

  • A two-sided consistency check on the probe: retry when "each more" comes out 0, as you suggest, and also when it comes out far above the one-expert time. On this box good starts had "each more" at ~0.4-0.85x the one-expert time (one at 2.0x, which still chose 1); the misreads were 2.7-13x.
  • Best of a few rounds, with an untimed warm-up first, as you suggest.
  • Re-plan in decode, as maya-ds4 and GLM's lane_retime already do. This would also cover a PC that gets busy after the start.
  • Warn when the split stages ≥2 of 4. Today a bad start shows only in that one line, and nothing later says the session is slow for that reason.

Happy to test a branch on this box.

<!-- gh-comment-id:6451967584 --> @talisp commented on GitHub (Oct 27, 2026): We see the same thing on a very different box, and more often: **4 of the 14 MiniMax starts that ran the probe today misread it, and the worst one held decode at ~6.5 tok/s for the whole session, against 14-17 on a good start.** Our misreads go the other way from yours, though. Yours read `+0.00 ms each more`. Ours read `+1.27`, `+1.29`, `+1.36` and once `+11.67 ms each more`, against 0.25-0.33 on good starts. So the consistency check you suggest (four experts no slower than one) would catch yours but not ours. A bound in the other direction would be needed too, or several rounds with the best one kept. **The case where it hurt most:** a start while ~550 GB of downloads had filled the page cache. 2 GB of RAM was free, `kcompactd0` sat at 100% of a core, and the previous engine (DeepSeek, 271 GB of host memory) had just exited. The probe read `0.88 ms (+11.67 ms each more) ... 3 staged`. For the whole session the CPU lane's 28 threads sat at ~30% each, waiting on staging copies, and the 3D tasks decoded at 6.3-6.7 tok/s. Other misreads came right after a previous maya-mm3 had exited, which fits your reading. But good starts came right after an exit too, so it isn't only that. **What we found answers your open question:** `MM3_LANE_SPLIT=0` isn't a safe workaround here. It cost **~11%** of decode against a normal `1 staged` start (15.0 / 15.3 against 16.7 / 17.3 tok/s, two runs each). The split pays off when it reads right. What has worked for us is your other workaround: restart until the start line says `0` or `1 staged`. The one restart we needed today read normal on the next try. The other two engines already re-plan in decode: maya-ds4 times the CPU lane again (`the CPU lane timed again in decode`), and GLM's fast path has `lane_retime` (re-plans when the CPU's cost drifts >15%). Doing the same in maya-mm3 would make a bad start harmless, whatever the PC is doing at that moment. The data follows. --- ### Machine and config - **GPU:** 1× NVIDIA L40S-48Q (vGPU, the whole 48 GB card). - **CPU and RAM:** Xeon Platinum 8580 VM, 32 vCPUs without SMT, 1 NUMA node seen; ~504 GB RAM; Linux 6.8. - **Model:** MiniMax-M3.1-Flash, Mia-AiLab's EXL3 3.55 bpw. 767 experts resident with `--chunk 8192` (961 with the default chunk); the pinned pool holds every other expert (~167 GB pinned). - **Maya:** v1.1.30 and v1.1.32 (no change to `calibrate_lane()` between them; v1.1.33 only fixes the setup's pack step). - **Benchmark:** - through the server, temperature 0, `reasoning_effort: low`; - the numbers are the server's own `timings`; - "quick" = an 8K-token read + 3 code prompts of 600 tokens; "speed" = 6 code prompts + reads of 8K / 32K / 128K. ### Every start we logged today Times are local; "after" = what ran just before. | # | Version / config | Start line (`CPU lane vs staging (measured): ...`) | Staged of 4 | Decode that session | |---|---|---|---|---| | 1 | v1.1.30, setup defaults (32 threads, chunk 1024, DSpark) | `0.37 ms (+0.75 ms each more), 1.14 ms to copy` | 1 | 13.0 (quick) | | 2 | v1.1.30, `--cpu-threads 29`, DSpark on | `0.37 ms (+0.30), 2.35 ms to copy` | 0 | 14.7 (quick) | | 3 | v1.1.30, `--cpu-threads 29`, DSpark off | `0.42 ms (+0.26), 1.14` | 0 | 12.4 (quick) | | 4 | v1.1.30, `--cpu-threads 27`, DSpark on | `0.39 ms (+0.33), 1.14` | 1 | 15.8 (quick) | | 5 | v1.1.30, `--cpu-threads 27`, DSpark off, after #4's engine exited | **`0.47 ms (+1.29), 1.16`** | **2** | **9.3** (quick), vs 12.4 at #3 | | 6 | v1.1.30, `--cpu-threads 27 --chunk 8192`, DSpark | `0.86 ms (+0.60), 1.14` | 1 | 14.4 (speed) | | 7 | v1.1.30, the same with `--chunk 16384` (541 resident), after #6's engine exited | **`0.38 ms (+1.27), 1.17`** | **2** | **10.0** (quick; confounded with fewer resident experts) | | 8 | v1.1.30, as #6, after DeepSeek exited, downloads filling the page cache (2 GB free, `kcompactd0` 100%) | **`0.88 ms (+11.67), 1.15`** | **3** | **6.3-6.7** (3D tasks, the whole session) | | 9 | v1.1.32, as #6, page cache relieved first (495 GB available) | `0.37 ms (+0.29), 1.14` | 0 | **16.7** (speed); 3D at ~18 | | 10 | v1.1.32, as #6 | `0.48 ms (+0.28), 1.14` | 1 | 16.7 / 17.3 (quick ×2) | | 11 | v1.1.32, as #6 + `MM3_LANE_SPLIT=0` | (no line: no split) | - | **15.0 / 15.3** (quick ×2) | | 12 | v1.1.32, as #6 + `--no-pin-pool` | (no line: no pool) | - | 14.4 / 14.6 (quick ×2) | | 13 | v1.1.32, as #6, after #12's engine exited | **`0.50 ms (+1.36), 1.14`** | **2** | (restarted) | | 14 | v1.1.32, the restart of #13 | `0.55 ms (+0.27), 1.14` | 1 | (normal) | | 15 | v1.1.32 local build (a page-cache test, same engine code otherwise), as #6 | `0.72 ms (+0.30), 1.14` | 1 | (normal) | | 16 | v1.1.32, Maya-S GGUF instead of EXL3 | `0.30 ms (+0.25), 0.59 ms to copy` | 1 | (being measured) | On v1.1.29 we had seen one more: `0.44 ms (+1.27 ms each more)`, `2 of 4 staged`, with `--cpu-threads 30`. That session staged 17,133 experts, routing waits rose to 60.7 ms a token (`MM3_TIMING=1`), and decode ran at 9.6 tok/s against 12.8 at `--cpu-threads 28`. **What the misreads have in common:** - The one-expert time is close to normal (0.38-0.50 ms; 0.88 in #8). The **"each more"** figure is 4-45x its usual 0.25-0.33 ms. - The copy time stays at 1.14-1.17 ms every time (2.35 once, at #2, which still chose 0). - So in our cases the four-expert call is the inflated sample, not the one-expert ones. The split then stages 2-3 of 4 experts over PCIe, when here the right answer is 0-1. ### Session #8, the worst one - **Memory:** `free -g` showed 503 total, 9 used, **2 free**, 491 buff/cache, 322 available. `kcompactd0` was at 100% of a core. - **CPU:** the engine was at ~840% CPU for 28 lane threads, i.e. ~30% each, waiting on staging copies (~1.15 ms each, serial per token). - **Decode:** the 3D tasks ran at 6.3 / 6.6 / 6.7 / 6.7 / 6.6 tok/s, and the thinking at 5.6. - **What we changed:** we stopped it, moved our downloads into a cgroup with `MemoryHigh` so their page cache can't fill the RAM, and dropped the cache of the model files not in use (`posix_fadvise(DONTNEED)`). Start #9 then read normally and decoded at 16.7 tok/s. ### `MM3_LANE_SPLIT=0` against a normal split (v1.1.32, same config, quick ×2) | | Decode | Prefill 8K | |---|---|---| | normal start, `1 staged` | 16.7 / 17.3 | 404 / 412 | | `MM3_LANE_SPLIT=0` | 15.0 / 15.3 | 408 / 414 | ### Related, in the sibling projects - **Niko1221/Strata#485 (closed):** the start-up PCIe probe read the same link at 18.5, 6.9 and 5.8 GB/s across starts. Strata 0.1.37 fixed it by timing four bursts and taking the fastest, since "a disturbance only slows a copy". The same holds for a CPU-lane timing: a busy PC can only make the four-expert call slower, so the best of a few rounds is the honest one. - **Niko1221/Strata#4007:** a start-up-only PCIe share against the runtime refinement (`PcieAuto`). Refining in decode gave 42-44 against 35-37 tok/s on the same card. - **#56 here (GLM, Windows, two NUMA nodes):** decode varied ~30% between restarts. A different cause (the DMA path across nodes), but the same start-to-start lottery. ### What we'd suggest, adding to yours - **A two-sided consistency check on the probe:** retry when "each more" comes out 0, as you suggest, and also when it comes out far above the one-expert time. On this box good starts had "each more" at ~0.4-0.85x the one-expert time (one at 2.0x, which still chose 1); the misreads were 2.7-13x. - **Best of a few rounds,** with an untimed warm-up first, as you suggest. - **Re-plan in decode**, as maya-ds4 and GLM's `lane_retime` already do. This would also cover a PC that gets busy after the start. - **Warn when the split stages ≥2 of 4.** Today a bad start shows only in that one line, and nothing later says the session is slow for that reason. Happy to test a branch on this box.
Author
Owner

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

Thanks - your reading of lane_cpu_add was exactly right. In v1.1.34, a probe where four experts take no longer than one is treated as disturbed. It is measured again on eight other experts, up to three rounds, and the least disturbed round is kept. A start whose first round reads normally behaves exactly as before. If every round stays disturbed and the split stages every expert, the log says so. The start line notes when a reading was measured again.

Closing - please reopen if it comes back.

Released in v1.1.34: https://github.com/mw00/project-maya/releases/tag/v1.1.34

<!-- gh-comment-id:6456004585 --> @mw00 commented on GitHub (Oct 27, 2026): Thanks - your reading of `lane_cpu_add` was exactly right. In v1.1.34, a probe where four experts take no longer than one is treated as disturbed. It is measured again on eight other experts, up to three rounds, and the least disturbed round is kept. A start whose first round reads normally behaves exactly as before. If every round stays disturbed and the split stages every expert, the log says so. The start line notes when a reading was measured again. Closing - please reopen if it comes back. Released in **v1.1.34**: https://github.com/mw00/project-maya/releases/tag/v1.1.34
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#223
No description provided.