mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #60] [MERGED] One CPU lane pool for a split of 3+ GPUs (9 GPUs: decode 25.7 -> 30.7 tok/s); calibration on fresh prompts and a copy of the usage file #308
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#308
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/60
Author: @needmorevram
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mw00
Base:
main← Head:glm-cpu-lane-threads📝 Commits (1)
d772eabOne CPU lane pool for a split of 3+ GPUs, sized as one GPU's (decode on 9 GPUs 25.7 -> 30.7 tok/s); the calibration measures on fresh prompts and works on a copy of the expert usage file📊 Changes
5 files changed (+193 additions, -30 deletions)
View changed files
📝
README.md(+10 -5)📝
src/core/glm_fast_path.cu(+46 -12)📝
src/core/glm_fast_state.hpp(+4 -2)📝
tools/calibrate_glm.py(+73 -11)📝
tools/test_calibrate_glm.py(+60 -0)📄 Description
Summary
Two fixes to how the GLM engine uses the CPU, found on a 9-GPU split:
cores / GPUsthreads (9 on a 9-GPU, 88-vCPU host). A decode token visits the cards one after another, so only one card's 9 threads ever worked and most of the CPU sat idle. Now one pool serves every card in turn, sized the same way as one GPU's pool. This is what Strata does: one expert pool for the whole process.--calibrate) measured an unrealistic case and rewrote the user's usage profile.How CPU threads are chosen
cores / GPUsthreads eachSTRATA_GLM_CPU_SHARED=0gives a pool per GPU again (A/B).STRATA_GLM_CPU_SHARED=1shares the pool on two GPUs too.STRATA_GLM_CPU_LANE<n>) keeps a pool of its own.Benchmark: 9 GPUs
Setup: Maya-L (156 GB) on 8x RTX 5060 Ti 16 GB + RTX 3090 24 GB, 2x Xeon Gold 6152 (88 vCPUs, 2 NUMA nodes), 177 GB RAM, 32K context.
Method: the same build and harness for both rows, A/B'd with
STRATA_GLM_CPU_SHARED=0. Greedy decode, thinking off, 256 tokens an answer, 3 rounds of 3 prompts, each prompt new to the engine (see the calibration change below), then one 8192-token prompt.That's +19% decode and +16% on the 8K prompt.
Benchmark: 2 GPUs (why two GPUs keep a pool each)
Setup: 3090 + 5060 Ti, same model. Within each pair the layer split and the CPU/PCIe plan are fixed (
STRATA_GLM_PCIE_SHARE=0), so only the pool layout differs.STRATA_GLM_CPU_SHARED=1)STRATA_GLM_CPU_SHARED=1.Calibration (
tools/calibrate_glm.py)expert_usage.txtafter every answer, and the next start loads the experts into VRAM in that order, so the tuning's answers were rewriting the user's profile. The calibration's engine now reads and writes a copy in a temporary folder. The user's file was unchanged after more than 100 calibration and benchmark answers.Output
As CONTRIBUTING notes, which expert runs on the CPU or the GPU can change the last bits. With the faster pool, the start-up plan hands more RAM-tier experts to the CPU (9 GPUs:
0 1 2 3 4 4 5 6 7becomes0 1 2 3 4 5 6 7 8on CUDA0). I did not compare greedy tokens.Changes
src/core/glm_fast_path.cu:shared_cpu_pool(), and the thread rule for a shared pool infast_cpu_lane_setup(sized as one GPU's, less a core for each other card's service thread; #44's pinning only for per-GPU pools).src/core/glm_fast_state.hpp:cpu_poolbecomes ashared_ptr, andWorkers::runtakes one batch at a time.tools/calibrate_glm.py: the 60 prompts,Session.next_group,usage_copy.README.md:STRATA_GLM_CPU_LANE's default, aSTRATA_GLM_CPU_SHAREDrow, theSTRATA_GLM_CPU_PINrow's scope, the tuning paragraph.tools/test_calibrate_glm.py: 4 tests (no prompt repeats in a run, the prompt groups,usage_copy,run()uses a copy).Checks
python tools/check_hip_compat.py: every CUDA name has a mapping (no new CUDA calls).--calibraterun on 9 GPUs completed (650 s) and kept the engine's own settings.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.