mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5020] [Engine] Arena mode keeps all 24,576 experts in RAM on top of the VRAM expert cache (44.9 GiB of the 71.7 GiB host copy is never read again) #2322
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2322
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?
Originally created by @radiumliu on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5020
Area
[Engine]
What do you want to do?
Keep the host copy of the experts the GPU cache already holds out of RAM in arena mode, instead of pinning all 24,576 of them. On this box that is 44.86 GiB that is copied into VRAM once and never read again — and it is what pushes a 125.7 GiB machine to 122 GiB and into OOM.
What do you do today instead?
Run the default arena (
--expert-cache auto, no--mmap-experts) and keep 20+ GiB of free RAM by hand: reclaim the GGUF page cache withmemory.reclaim, raise the systemd-oomd threshold, and add swap. The only documented ways to stop the duplication are the low-RAM modes, which mean leaving the arena for--mmap-experts— reasonable for a 32–64 GB PC, but they are described as a mode for PCs that cannot hold the experts at all, not for a 128 GB box that can hold them and then has nothing left for the rest of the system.Environment
0.1.55(f-029-rel 99866a47a2b8, cuda12.9 build), installed by the Terminal6.8.0-117-generic, systemd 255Qwen3.8-Flash-NextUD-Q4_K_XL (Unsloth, 4 shards, 103.69 GiB), native pack (unsloth-ud-q4_k_xl, experts read in place from the GGUF shards)--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp … --max-context 262144 --kv int8 --ple-io ram --kv-resident 32768 --vision --vram-reserve-mib 700 --layer-split auto--layer-split autoputs layers 0–22 on CUDA0 and 23–47 + head on CUDA1; expert cache 15,361 slots = 44.86 GiB of VRAM (21.97 + 22.89), 731/182 MiB free per cardThe duplication, measured
The pack itself states the full expert table size in the header of
native_experts.txt:77,017,907,200 B = 71.732 GiB = 48 layers × 512 experts = 24,576 blobs.
/proc/<engine-pid>/smaps, aggregated by mapping, shows one anonymous region of exactly that size, fully resident:So the host side holds all 24,576, while the GPU side holds 15,361 of those same blobs as a copy. 15,361/24,576 = 62.5 % of the arena is duplicated in VRAM, and the engine's own cache policy is static and has no eviction (
expert cache … ranked by routing frequency, no eviction), so those 44.86 GiB of host bytes are never read after the cache is filled. What the CPU expert pool actually serves is the remaining 9,215 experts = 26.9 GiB.What it costs in practice
At midnight the box was killed three times in 90 minutes, and not by the kernel OOM killer:
systemd-oomdkilled the wholeuser@1000slice (engine, web UI, gateway and three more services in the same 0.13 s) because the session's PSI stayed above Ubuntu's 50 % limit with reclaim activity. The kernel log has noKilled processline at all. The engine's own PSI was 0.00 during the event — it was the other tasks on the box that were stalled on memory.With ~45 GiB less pinned anon, this box would have had ~45 GiB of headroom and none of that would have happened. Note also that
VmLckfor the engine is 0 and systemMlockedis 80 kB, so the arena is not mlock'd here (cudaHostRegister PORTABLE okcovers the transfer/KV path only) — it is ordinary anonymous memory, which is why enlarging swap helps a little, but the copy still should not exist.The ask
Any one of these would close it:
--resident-cpu-expertsdescribes for the mmap mode — it just is not reachable while the arena is in use.--resident-experts/--resident-cpu-expertsis the intended answer for a two-GPU layer split with a native pack, say so indocs/DETAILS.md: today the doc places both under "Low-RAM modes (chosen by setup)" / "when the RAM cannot hold them beside the system", which reads as "not for a 128 GB box".--resident-budget-gibequivalent for the arena), so the budget maths can close.STRATA_ARENA_MMAP=1is not it here: the release note for 0.1.39 measures it well (2×16 GB GPUs, 32 GB RAM, ~1 → 25 GB available), but it mapsexperts.bin, and this native pack has noexperts.bin(it carriesdense.bin,index.txt,native_experts.txtand points into the GGUF shards). If it works against the shards too, a line in the docs would say so.Related
[Engine]prefix, not by a maintainer, so the ask was never answered.Evidence available
Happy to attach: the full 6-hour audit series (30 s cadence: meminfo, engine
smapsaggregate, cgroupmemory.stat/memory.current,/proc/pressure/memory, oomd's own log for the three kills), the engine startup log with every sizing line (arena, layer split, cache slots, PCIe probe), and the before/after numbers for a manualmemory.reclaimthat released 24.2 GiB of GGUF page cache with no change in decode throughput (mean 69.5 vs 69.8 tok/s over the 8 requests immediately before and after).