mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #80] [MERGED] GLM split: load the parts at once, one thread each #321
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#321
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/80
Author: @ksanislo
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @mw00
Base:
main← Head:parallel-split-load📝 Commits (3)
48e8ae4GLM split: the parts load at once, one thread each (STRATA_GLM_PARALLEL_LOAD=0: one after another)5ff996cMerge remote-tracking branch 'origin/main' into fix80fff29bbParallel split load: the parts plan their RAM tiers in turn, then all pin at once - the first part's measurement sees no later part's prompt staging (#80 with #85)📊 Changes
4 files changed (+147 additions, -19 deletions)
View changed files
📝
include/strata/core/glm_model.hpp(+24 -0)📝
src/core/glm_fast_path.cu(+74 -18)📝
src/core/glm_fast_state.hpp(+2 -0)📝
src/core/glm_model.cu(+47 -1)📄 Description
A split's parts load one after another today, and on a multi-GPU box that adds up: on 4x Tesla T4 with Maya-L, each part spends ~11 s pinning its RAM tier (one thread, no disk), ~15 s warming its tiers from the SSD, and ~1.7 s calibrating its CPU lane, for ~120 s of engine time before the first token. The CPU sits ~75% idle the whole time, and the disk idles while each part pins. This PR loads the parts at once, one thread per GPU;
STRATA_GLM_PARALLEL_LOAD=0keeps the sequential load.The parts still take the RAM tier's budget in part order, so each gets the same tier as before. A part takes its planned size from the budget and then lets the next part on, before it pins. The CPU lane is set up only after every part has loaded, one part at a time: its calibration times the CPU and the PCIe link, which the other parts' loading would otherwise be using. The parts stay unlinked until all have loaded, because
load_packends inreset(), which walkssplit_next_.A one-line-looking change makes the parallelism actually work.
cudaHostRegisterused to fault the RAM tier's pages in (17–28 GB a part), and it holds the CUDA driver's lock while it does. Each part's warm-up copies then waited until the last part had finished registering, and the first parallel version was barely faster (130 vs 135 s).numa_pinnednow faults the pages in itself, by touching each page on the calling thread before registering. So the registration only pins pages that are already there and holds the lock briefly, and the parts fault in their tiers concurrently, alongside each other's disk reads. It's still one thread per region, which keeps the huge pages: AnonHugePages measured 105.7 GB against 105.9 before.Results on 4x T4 (2-socket Xeon, NVMe on PCIe 3.0 x4 with a 3.1 GB/s ceiling), Maya-L from a cold page cache: load to first token 142 → 96 s, with the warm-up now reading at the disk's ceiling (3.0 GB/s, was 2.7 with gaps between parts). Decode and prefill are unchanged (
--bench, runs interleaved: 12.8 / 12.8 vs 12.9 / 12.6 tok/s, prefill identical). Tier sizes and plans are unchanged, except that the last card now sizes its expert pool before the other parts' pinned memory has taken its small share of VRAM: 88 slots a layer instead of 87, leaving ~485 MB free, about what the first card always had.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.