mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #654] Qwen CYBER-FROST on RAM-short PCs: unbuffered expert reads, context leaves VRAM to experts #652
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#652
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/654
Author: @mw00
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:cf-mercury-1137📝 Commits (1)
ee47bb6Experts that no tier holds are read unbuffered; Qwen setup keeps VRAM for experts on RAM-short PCs📊 Changes
4 files changed (+140 additions, -18 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+7 -1)📝
maya.py(+6 -4)📝
src/core/expert_source.cpp(+123 -13)📝
tools/test_setup_qwen.py(+4 -0)📄 Description
CYBER-FROST (Q5_K_M, 112.5 GB) on a Tesla V100 32 GB + 30 GB RAM + NVMe decoded ~6.6 tok/s, far below the same model on a V100 with 61 GB RAM.
Cause. Experts that neither VRAM (21 GiB) nor the RAM tier (22 GiB) holds are ~40% of the model; they are read from the GGUF when routed. A decode then pulls ~2 GB/s off the NVMe, and
perfshows the CPU expert workers waiting for those reads (79% of samples in the pool's wait loop). The reads went through the mmap: 4 KB page faults plus a file cache that a 30 GB PC cannot spare (vmstat~0.9 GB/s, swap and kswapd active) while the same NVMe reads 3.2 GB/s unbuffered at queue depth 4+. The setup also recommended a 256K context (KV 3.5 GB, 12% of the VRAM) that took the VRAM from the expert cache.Changes.
GgufExpertSource: on Linux the misses are read unbuffered (O_DIRECT), one task per slice (gate/up/down) over the existing stagers, into the staging ring. A sample of experts is compared with the mapping at open; a file system that refuses O_DIRECT, or any mismatch, keeps the mapping (MAYA_EXPERT_DIRECT=0turns it off). Windows and macOS paths are unchanged.MAYA_EXPERT_HEADROOM_GBfor measuring).memory_gb), the recommended context's KV takes at most 6% of the VRAM instead of 12% (V100 32 GB + 30 GB RAM: 128K). PCs that hold every expert are unchanged (a 3x V100 / 183 GB PC still gets 256K).Measured (Mercury: V100 32 GB, 30 GB RAM, NVMe; decode tok/s, greedy, 3 prompts, warm, MTP on, internal numbers):
MAYA_EXPERT_DIRECT=0(old read path, 128K)Run-to-run noise is about 0.5 tok/s. The NVMe is the limit now (~2.2 GB/s of 3.2); stager count 12 and MTP window 2-3 did not change it. The model needs ~113 GB; a PC with RAM for it (61 GB V100 PC: 25-31 tok/s) does not read the disk at all.
Checks.
python -m unittest tools.test_setup_qwen(context cases added). The engine builds on Linux/CUDA; the non-Linux code is only guarded out. A PC that holds every expert in RAM never takes the miss path.Not changed: nothing hidden or disabled. A longer context stays a choice in the setup and in the config.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.