mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#5504
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/5531
Author: @pjgmobile
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:fix/1m-arena-linux-file-cache📝 Commits (2)
6864dce#5327: on Linux an expert-arena shortfall the file cache can serve loads through it again - the 0.1.55 warn-and-proceed (free pages + Cached+Buffers+SReclaimable-Shmem-Dirty cover the need: MemAvailable credits only half the cache), said loudly on stdout as well, because a service setup never sees stderr; the #4846 refusal stays for shortfalls it cannot serve (#4051's anonymous RAM), under a cgroup limit, and on Windows, and STRATA_ARENA_FILE_CACHE=0 turns the credit off; tests63cf748#5327: correct the comments - MemAvailable does not credit "only about half" of the page cache (it counts nearly all of it, minus the low watermark); the false alarm this fixes is the reserved hugetlb pool, which MemAvailable does not count at all. The file-cache credit stays as a small secondary margin. Comments only, no code change.📊 Changes
4 files changed (+140 additions, -3 deletions)
View changed files
📝
include/strata/core/ple_residency.hpp(+60 -0)📝
src/core/expert_source.cpp(+42 -2)📝
src/core/ple_residency_test.cpp(+31 -0)📝
src/program/generate.cpp(+7 -1)📄 Description
Fixes #5327.
What
At 0.1.56 the arena RAM guard (#4846, for #4051) started refusing every
MemAvailable < needshortfall and taking the--mmap-expertsfallback for the run. On Linux that misreads a safe shortfall as #4051's stall:MAP_HUGETLBfirst. The reserve itself takes MemAvailable below the need while holding precisely the pages the load wants. That is the issue's box: 12.8 GiB available for a 31.64 GiB arena with the pool reserved, decode 47 tok/s on 0.1.56-0.1.58 against 116-122 tok/s on 0.1.54/0.1.55, which loaded anyway (expert arena read through the file cache).(Correction: the first commit's message and an earlier version of this description said MemAvailable credits only about half of the page cache. That was wrong; the follow-up commit fixes the code comments.)
This restores the warn-and-proceed for exactly those cases. After the existing 20 s wait and the give-back, when the shortfall can be served without touching swap or any program's anonymous memory -
MemFreeplusCached + Buffers + SReclaimable - Shmem - Dirty, plus the free hugetlb pages when they hold the whole arena (the MAP_HUGETLB try is all-or-nothing, so a smaller pool serves none of it and is not credited) - the arena loads as 0.1.55 did, and says so on stdout as well as stderr (a service setup never sees the engine's stderr; the line is printed pre-READY, so the app server's protocol reader ignores it, and a direct--servedeployment gets it in its service log). The #4846 refusal stays where #4051's stall risk is real: a shortfall those pages cannot cover (anonymous RAM, e.g. an engine still exiting), under a cgroup limit, and on Windows (the proceed path was never trusted there - its own old note said "buffered (not Windows)", and the mapped-view trim needs the headroom the refusal keeps).STRATA_ARENA_FILE_CACHE=0turns the credit off and refuses as since 0.1.56;STRATA_ARENA_RAM_FALLBACK=0still restores the whole old behaviour.ple_residency.hpp(arena_shortfall_served_by_file_cache,meminfo_free_and_droppable), used at theFallBackverdict inArenaExpertSource::open; the proceed sets the usualram_warning_(the caller's pre-load WARNING) and adds the stdout linenot enough RAM for the expert arena ... reads the experts from the filefallback notice is printed on stdout too, so the slow mode is visible in a service log even where the refusal still appliesple_residency_test.cpppin the two poles: the issue's box (load) and #4051's box (keep the fallback)Receipts
Same box, same lane/model/args, one fresh boot per arm (kill + GPU-drain gate between boots; decode = client-side tokens in the first 30 s after first token; Qwen3.8-Flash-Next GSQ-RCO Q2_0,
--max-context 1048576,--kv int8 --kv-resident 32768). Hardware class: RTX 3090 24 GB + RTX 3060 12 GB (sm_86), 62 GB RAM, Linux. The stock arm is the official 0.1.58 cuda13 component; the patched arm is this branch built locally (CUDA 13.1, sm_86, Release).not enough RAM for the expert arena (it needs 31.64 GiB and 12.83 GiB is available (18.82 GiB short, after waiting)): this run reads the experts from the file, like --mmap-experts- stderr only, nothing on stdoutWARNING: ... 46.50 GiB of free pages, droppable file cache and free huge pages can still hold it: loading through the file cache, as 0.1.55 did (#5327 ...)on stderr AND stdout, thenexpert arena read through the file cache (buffered (not Windows)),expert arena: cudaHostRegister PORTABLE ok; hugetlb 2 MB pages,loaded 31.64 GiB at 3.10 GiB/sWARNING: ... the load may swap ... (#4051)), same proceed linesAt
--max-context 262144the patched engine measures 114.8 tok/s (FAST); that boot was short as well (23.1 GiB available) and proceeded through the file cache the same way, so the fix also covers the smaller-context boots the issue saw falling back on a cache-hot box. Full-run decode on the patched @1M arm was 123.1 tok/s (5817 tokens), matching the issue's 0.1.54/0.1.55 band (116.4-119.9) against its 0.1.56+ band (45.7-54.3).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.