mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #286] [CLOSED] Low RAM on Windows: a pinned tier of the most-read experts, the rest read unbuffered from experts.bin #2552
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#2552
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/Niko1221/Strata/pull/286
Author: @sergqwer
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:pr/low-ram-tier📝 Commits (2)
119b7c7Start: read the expert arena unbuffered, register it while it loads, on its own threada92328fLow RAM: a pinned tier of the experts the engine reads from RAM, the rest from experts.bin (Windows)📊 Changes
10 files changed (+1283 additions, -67 deletions)
View changed files
📝
docs/DETAILS.md(+8 -0)📝
include/strata/core/expert_source.hpp(+133 -0)📝
include/strata/core/pinned.hpp(+18 -0)📝
include/strata/prefill/gemm.hpp(+4 -0)📝
setup.py(+9 -3)📝
src/core/expert_source.cpp(+693 -8)📝
src/core/pinned.cu(+100 -0)📝
src/prefill/gemm.cu(+32 -2)📝
src/prefill/prefill.cpp(+17 -5)📝
src/program/generate.cpp(+269 -49)📄 Description
Summary
Stacked on #285 (it uses its deferred per-layer registration). Only the last commit is new here.
The resident arena holds every expert, including the VRAM cache's share of them a second time. A PC whose RAM cannot
hold them beside the system has setup's low-RAM mode,
--mmap-experts, which leaves the experts to the OS filecache. On Windows that cache fills RAM and gets trimmed, and decode falls off. On the NVFP4 fork, copying blobs
through the mapped file made Windows trim and decode fell from 72 to 33 tok/s.
TieredExpertSourcekeeps host copies only where the engine reads them:minus
STRATA_RAM_RESERVE_GIB(default 6). They go in by rank: first the experts outside VRAM, then the VRAMcache's tail that the prompt path borrows. The GPU copies them by DMA like the full arena's.
experts.binunbuffered, so the file cache neither grows nor gets trimmed. Adecode token's misses are prefetched per layer (
begin_layer), the prompt path's stager reads them withread_blob, and lent slots are refilled from the file.its VRAM slot first); one entering VRAM gives its slot back.
--low-ram,--no-low-ramand--ram-budget GIBcontrol it. It also switches on by itself when the pack hasexperts.bin(setup writes it only for its low-RAM mode) and the experts plus 16 GiB exceed the RAM installed. Itneeds one GPU, an
--expert-profile, and no remote experts. setup's low-RAM mode passes--low-ramon Windowsinstead of
--mmap-experts. The loader is Windows-only for now, so Linux keeps--mmap-experts.Measured
Measured on current main (0.1.29,
d6708a4) with ISTA-DASLab's IQ2_XS, RTX 5090 32 GB, Ryzen 9 9950X3D, 128 GB DDR5, Windows 11. KL is first-token KL divergence (STRATA_DUMP_FIRST_LOGITS, #276); two runs of main itself differ by 0 on 5 of 6 short prompts and by 0.00013 on the sixth.arena and the tier (
--ram-budget 8) generate the same 128 tokens.STRATA_TIER_VERIFYcompared 5,460 hostcopies with the file, and later 5,604 including the ones copied back from VRAM by the adaptive tier: 0 differ.
149.6 with the full arena (static cache, no PCIe share, 128 tokens).
With 96 GB or more nothing changes: first-token KL to the arena is exactly 0.
Switch
--no-low-ramgives the full arena;--mmap-expertsstill selects the mapped file.🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.