mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[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
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#223
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?
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:The same config on the same card normally reads:
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 copyand still chose1 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.pyon one card. It was the second engine start of that run, right after the first engine (with about 100 GB pinned) had exited.none, gain −0.123dspark, gain +0.106So 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 fixedlane_split(4)for the session.Suggestions
These are ideas; you know the trade-offs better.
lane_cpu_addclamped to 0.lane_run), and take the best of a few rounds.Workaround meanwhile: restart when the start line says anything but
1 staged. We haven't measured whetherMM3_LANE_SPLIT=0(no split at all) costs anything against the normal1 staged.@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.36and 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,
kcompactd0sat at 100% of a core, and the previous engine (DeepSeek, 271 GB of host memory) had just exited. The probe read0.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=0isn't a safe workaround here. It cost ~11% of decode against a normal1 stagedstart (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 says0or1 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 haslane_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
--chunk 8192(961 with the default chunk); the pinned pool holds every other expert (~167 GB pinned).calibrate_lane()between them; v1.1.33 only fixes the setup's pack step).reasoning_effort: low;timings;Every start we logged today
Times are local; "after" = what ran just before.
CPU lane vs staging (measured): ...)0.37 ms (+0.75 ms each more), 1.14 ms to copy--cpu-threads 29, DSpark on0.37 ms (+0.30), 2.35 ms to copy--cpu-threads 29, DSpark off0.42 ms (+0.26), 1.14--cpu-threads 27, DSpark on0.39 ms (+0.33), 1.14--cpu-threads 27, DSpark off, after #4's engine exited0.47 ms (+1.29), 1.16--cpu-threads 27 --chunk 8192, DSpark0.86 ms (+0.60), 1.14--chunk 16384(541 resident), after #6's engine exited0.38 ms (+1.27), 1.17kcompactd0100%)0.88 ms (+11.67), 1.150.37 ms (+0.29), 1.140.48 ms (+0.28), 1.14MM3_LANE_SPLIT=0--no-pin-pool0.50 ms (+1.36), 1.140.55 ms (+0.27), 1.140.72 ms (+0.30), 1.140.30 ms (+0.25), 0.59 ms to copyOn 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:
Session #8, the worst one
free -gshowed 503 total, 9 used, 2 free, 491 buff/cache, 322 available.kcompactd0was at 100% of a core.MemoryHighso 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=0against a normal split (v1.1.32, same config, quick ×2)1 stagedMM3_LANE_SPLIT=0Related, in the sibling projects
PcieAuto). Refining in decode gave 42-44 against 35-37 tok/s on the same card.What we'd suggest, adding to yours
lane_retimealready do. This would also cover a PC that gets busy after the start.Happy to test a branch on this box.
@mw00 commented on GitHub (Oct 27, 2026):
Thanks - your reading of
lane_cpu_addwas 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