Repository navigation
fix(strata): check remaining cgroup memory before loading the expert arena - #308
Merged
linyubupa merged 1 commit intoNov 19, 2026
Merged
Conversation
agourakis82
marked this pull request as ready for review
November 19, 2026 09:58
agourakis82
requested review from
hattori7243,
linyubupa and
shuk777
as code owners
November 19, 2026 09:58
linyubupa
approved these changes
Nov 19, 2026
philmcneely
pushed a commit
to philmcneely/Edge0
that referenced
this pull request
Nov 19, 2026
…rving headroom Edge0-AI#301: a container whose memory.max holds the expert arena but nothing else loads it, serves for a while and is then OOM-killed mid-conversation, because the kernel stops the group instead of reclaiming its pages. Edge0-AI#308 catches this only when the remaining capacity is below the arena itself; the case that was reported - 29 GiB limit, 26.66 GiB arena, 2.50 GiB of recommended serving headroom missing - still started and still died. The headroom is now a refusal when a cgroup limit is in force, with the numbers and three ways out (a smaller arena, a higher limit, or STRATA_ARENA_HEADROOM_MIB=0 for a caller that never opens a conversation). A bare host keeps the warning: its pages can be reclaimed, so there the recommend-not-force rule still holds. The bare-host message now reports the effective headroom, which STRATA_ARENA_HEADROOM_MIB can change. Verified on the FC500T box in a user cgroup: 145B NVFP4 under MemoryMax=48G refuses with "needs 44.30 GiB ... leaves 45.06 GiB: that is 1.74 GiB short of the recommended 2.50 GiB"; 120B NVFP4 under 35G refuses likewise; a limit below the arena still takes the Edge0-AI#308 message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The expert arena can fit below a cgroup's total limit while exceeding its remaining capacity. Check remaining capacity after the existing wait and resample, and exclude tmpfs and shared memory from the disk cache credit. Warn when the arena fits with little room left for serving. The 120B guide shows how to set a lower resident expert budget.
Related to #301.
Area
edge0-strata, expert arena admission)edge0-infer/docs/edge0-120b.md)How was it tested?
Linux, RTX 4000 Ada, official Edge0-120B-q3k at
ad5ea45a67ab6cd6761c364793bebb363a69720c, native serving protocol, cgroup v2 with swap disabled. This standalone build used3b056d5with the arena patch.With a 29 GiB limit and a real 5 GiB shared anonymous mapping in the same cgroup, an earlier candidate credited the shared memory as file cache and was OOM-killed. The submitted candidate refused before allocation with 26.66 GiB required and 22.93 GiB available, with zero OOM kills. Under the same pressure, the 16 GiB resident expert budget completed all three requests. The full arena also completed all three at 29 GiB without the extra mapping and refused the 27 GiB case before allocation.
ctest -R '^(arena_memory_test|memory_guard_test|file_expert_source_test)$' --output-on-failurepassed all three suites on Linux. Fixtures cover shared memory alone, mixed disk cache, missing and racy counters, and the production cgroup parser. The 2.5 GiB advisory does not estimate peak serving memory. The reporter's HTTP benchmark was outside this validation.Windows x64,
675054f8. A separate GitHub Actions job built and linkedstrata.exein Release with Visual Studio 2022, MSVC 19.44, CUDA Toolkit 13.0.3 andsm_89. All 16 arena memory checks passed withclang-clin C++23. Windows GPU execution and Windows Arm64 were outside this run.macOS arm64,
675054f8. The stock Strata Metal build linked andstrata --helpexited successfully.runtime_hellopassed on an M5 Max. The arena memory test passed all 16 checks in C++23 Release and with ASan/UBSan. Model serving on Metal was outside this run.Checklist
Local pre-submit checks on the current Edge0 base passed all 15 L0 checks and the three targeted L1 tests for platform, platform memory and execution budget. The full Edge0 CPU build with a C++23 override failed in the unchanged CLI source (
serve_protocol.cpp, string/JSON equality); the stock Edge0 preset uses C++17. The GPU tests above exercised the Strata binaries separately.