mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #44] [MERGED] GLM split and prompt chunks: --layer-split auto, --prefill auto | N, per-GPU CPU lane pinning, RAM-tier huge-page fix #297
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#297
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/44
Author: @needmorevram
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mw00
Base:
main← Head:glm-split-prefill📝 Commits (1)
dee8818GLM split and prompt chunks: --layer-split auto prices every placement, --prefill auto | N sizes the chunk from each card's pool, each GPU's CPU lane on CPUs of its own, the RAM tier's huge pages only when free 2 MB blocks cover it📊 Changes
9 files changed (+1191 additions, -188 deletions)
View changed files
📝
README.md(+26 -2)📝
include/strata/core/glm_model.hpp(+11 -0)📝
maya.py(+44 -1)📝
src/core/glm_fast_path.cu(+198 -4)📝
src/core/glm_fast_state.hpp(+28 -3)📝
src/core/glm_model.cu(+534 -79)📝
src/core/glm_prefill.cu(+251 -99)📝
src/program/generate.cpp(+14 -0)➕
tools/test_maya_prefill.py(+85 -0)📄 Description
Summary
This adds an automatic layer split and prompt-chunk sizing to the GLM path. It also makes a split's CPU lanes pin to their own CPUs on any machine and fixes a RAM-tier stall on the second GPU. Nothing is tuned to one machine. Every number is derived at load time from the cards, the host and the pack.
--layer-split auto: split searchBefore the layers load, every placement on 2–4 GPUs is priced by the decode time it predicts:
The fastest placement that every card can start (pool floor plus a 512-token chunk) is chosen. A two-GPU split with MTP drafting is priced by its slower card; other cases add up the cards. Ties go to the balanced placement. With more than 4 GPUs the split stays by free VRAM.
STRATA_GLM_SPLIT_LOG=1prints every placement.--prefill auto | N | 0: chunk calculationauto(written by setup): the largest chunk on the 256-token grid, up to 8192, whose buffers each card's expert pool can lend. A card lends up to 90% of its slots, or 85% when under 90% of the expert bytes are held pinned. A route's experts plus the spares always stay. The prestage buffer is the ring.N(e.g.32768, a plain number): that chunk, halved until the pool can lend it.0: token by token.maya.pykeeps an edited value when setup runs again.--prefill 32768with 96 GB of RAM or more.STRATA_GLM_CPU_PIN: per-GPU CPU lanes on CPUs of their ownEach part of a split gets its own CPUs:
The process affinity mask is respected. Before this change, the parts' pools shared cores: one part's idle workers spun while the other worked.
STRATA_GLM_CPU_PIN=0turns pinning off for A/B tests.RAM tier: huge pages only when free 2 MB blocks cover it
MADV_HUGEPAGEis now applied only when/proc/buddyinfoshows enough free blocks of order ≥ 9 to cover the tier. A split's second card used to pin its tier after the first had taken most of the RAM. On fragmented memory it sat in kernel compaction for over 10 minutes. With 4 KB pages the same tier (34.8 GB) pins in 12 s.Measurements
Measured with a 137 GB community 3.5-bit quant of GLM-5.3-Flash (Q3_K/Q2_K experts; not one of the setup's downloads). Prompt speeds are in tokens/s:
--prefill auto(8192-token chunks)--prefill 32768--prefill auto(8192)--prefill auto.Changes
src/core/glm_model.cu: split search (glm_search_bounds,host_read_bps), split setup, and the smallest-card chunk cap.src/core/glm_prefill.cu:prefill_mode, theauto | Nchunk bisection,prefill_cap/prefill_settle.src/core/glm_fast_path.cu,src/core/glm_fast_state.hpp:part_cpuspinning,pool_avail, the buddyinfo huge-page check.include/strata/core/glm_model.hpp,src/program/generate.cpp: the new members and passing--prefillthrough.maya.py:--prefill autoin the config's args, kept across setup runs, plus the RAM tips.README.md:--prefilloptions and measured table, the split search, the pinning and env rows.tools/test_maya_prefill.py: 2 new tests.Testing
tools/test_maya_prefill.py.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.