mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #24] [MERGED] CPU lane: time the PCIe link with the GPU awake, serve in-flight demotions from RAM instead of disk, per-GPU lane threads #283
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#283
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?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/24
Author: @tanutanu56
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @mw00
Base:
main← Head:cpu-lane-link-wake-demote-wait📝 Commits (1)
6725aa0CPU lane: time the PCIe link with the GPU awake; serve in-flight demotions from RAM; per-GPU lane threads📊 Changes
2 files changed (+48 additions, -5 deletions)
View changed files
📝
README.md(+1 -0)📝
src/core/glm_fast_path.cu(+47 -5)📄 Description
Fixes the two findings from #13, plus the per-GPU
STRATA_GLM_CPU_LANE<n>knob you said was welcome. Rebased on main (v1.0.14).Changes (
src/core/glm_fast_path.cu, README)fast_cpu_lane_setup: time the link with the GPU awake. A short%globaltimerspin kernel runs on a side stream while the one-expert copies (and the streaming copies forcpu_ps_ms) are timed, after a 400 ms ramp. Without it a consumer card at P8 has its link at Gen1: on an RTX 4070 Ti SUPER (PCIe 3.0 x4) one expert timed 10.1 ms against 2.6 ms awake, and on an RTX 5070 Ti (4.0 x16) 1.93 ms against 0.25 ms, so the plan sent most RAM-tier experts to the CPU on a link that was really 2.5x faster than the CPU. 24 reps instead of 12.fast_servicemiss path: a demoted expert whose copy is still landing is read from its RAM slot, not from disk. An expert evicted from VRAM infast_boundarystep (3) sits inkRDemotewith its D2H copy inF->draininguntil the next boundary makes it live. The miss path only took slots inkRLoad/kRNew, so a route needing that expert in the meantime fell through to the disk read. The fix waits on that drain's event (a ~0.3 ms copy against a ~13 ms disk read) and uses the slot. Only entries that are really inF->drainingare taken, so the background-move demotions are untouched.STRATA_GLM_CPU_LANE<n>sets the lane threads for CUDA<n>alone (falls back toSTRATA_GLM_CPU_LANE). README Tuning table row added.Measured
2x consumer GPUs: RTX 4070 Ti SUPER 16 GB (PCIe 3.0 x4) + RTX 5070 Ti 16 GB (PCIe 4.0 x16), Ryzen 7 3700X, 128 GB DDR4, Windows 11, Maya-S, 32K context. Official
maya.py --bench, v1.0.14:STRATA_GLM_SPLIT=17,STRATA_GLM_CPU_LANE0=6,STRATA_GLM_CPU_LANE1=2The defaults gain less than on v1.0.11 (where I first measured 7.1 -> 14.6 with the same two fixes), since #12 and
--calibratealready improved the start-up guess; the per-GPU thread counts are what the two unequal links need. With the CPU lane off (STRATA_GLM_CPU_LANE=0), 96-token greedy answers: 400 -> 300 ms/token.Greedy parity
I could not get token-identical output, and I'd rather say why than hide it:
STRATA_GLM_CPU_LANE=0,STRATA_GLM_RAM_GB=60,STRATA_GLM_NO_SPEC=1, temperature 0, 3 chat prompts + a 2k and a 6k document prompt): identical in all 5.STRATA_GLM_RAM_GB=45instead of 60: also differs in 4 of 5 (first differences at token 38, 7, 1, 9).STRATA_GLM_UNIFORM_SLOTS=1(a different VRAM layout) stays identical.So on this machine the output depends on where the experts come from (RAM against disk), and this PR changes that mix, so a bit-exact comparison is not a pass/fail test here. I have not found the source of that dependence. Your V100 parity tests would tell if it is specific to my setup.
Not included
--kv int8 --kv-resident 20480hanging on the second request (reported in #13): I could not reproduce it on v1.0.14 with 9 varied requests (multi-turn, 2.5k-token prompt, Japanese). It was seen on v1.0.11.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.