mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5220] [Engine] PLE auto-residency over-admits on systems with enough RAM for arena + PLE, pushing usage to 90% #3109
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#3109
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 @chai-kung on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5220
Problem: The PLE (n-gram) table's auto-residency policy admits the table into
RAM whenever table + arena + headroom fits available memory. On a 96 GB system
with ISTA GSQ-RCO models, this condition is met by a narrow margin, but the
result is ~90% RAM usage with no room for other applications. The arena alone
(without PLE) uses ~41% and delivers the same generation speed.
Environment: Strata 0.2.9 (engine 0.1.56), Windows 10 22H2, 96 GB DDR4 RAM,
RTX 5070 Ti 16 GB (main) + RTX 3060 12 GB (off).
Reproduced with Q2_0; same policy path applies to IQ2_XS, IQ3_XXS, IQ3_S
(all ISTA GSQ-RCO sizes share the same PLE table format).
Reproduce:
is close to available RAM (96 GB in this case)
Expected: RAM usage proportional to what the model actually needs for
generation speed. The PLE table (~26.8 GiB) should not be locked in RAM
when doing so pushes total usage to ~90% and provides no measurable
generation speed benefit.
Actual:
Default (arena + PLE resident):
RAM: 90% (85.6 / 95.4 GB)
Speed: 124.2 tok/s
With STRATA_PLE_AUTO_RAM=0 (arena only, PLE on disk):
RAM: 51% (47.8 / 95.4 GB)
Speed: 128.0 tok/s
The PLE table consumes 26.8 GiB of RAM but provides no measurable
generation speed improvement (suffix drafts read the table, but the
OS file cache serves them after the first access on NVMe).
Evidence from engine log (default run):
--ple-io ram chosen by the residency policy (the table is 26.8 GiB,
the expert arena still to fill 33.0 GiB and 68.9 GiB of RAM is available)
PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 17.7 s
The admission check:
available >= table_bytes + arena_bytes + headroom
68.9 GiB >= 26.8 + 33.0 + 8.0 = 67.8 GiB → admits (1.1 GiB margin)
Result: 33 GiB (arena) + 26.8 GiB (PLE) + ~5 GiB (runtime) + ~20 GiB
(Windows file cache from GGUF reads) = ~85 GiB = 90% of 96 GB.
Root cause: ple_resident_admit() in include/strata/core/ple_residency.hpp
admits the PLE table when table + arena + headroom fits available RAM. It
does not consider:
file cache (NVMe SSD)
The policy was designed to avoid the case where PLE + arena exceeds RAM
(issue #4518, ERROR_WORKING_SET_QUOTA on 64 GB). On systems where it
barely fits, the policy admits the table and RAM usage reaches ~90%.
Affects all ISTA GSQ-RCO sizes:
Q2_0: arena 34.0 GB + PLE ~26.8 GB + headroom 8 GB = 68.8 GB
IQ2_XS: arena 35.5 GB + PLE ~26.8 GB + headroom 8 GB = 70.3 GB
IQ3_XXS: arena 42.9 GB + PLE ~26.8 GB + headroom 8 GB = 77.7 GB
IQ3_S: arena 50.3 GB + PLE ~26.8 GB + headroom 8 GB = 85.1 GB
Workaround: Set STRATA_PLE_AUTO_RAM=0 in the config's env. The PLE table
stays on disk reads (served by OS file cache after first access). Arena
mode is unchanged, generation speed is unaffected. RAM drops from ~90%
to ~41-57% depending on model size.
Measured result with workaround (Q2_0, 96 GB system):
7198 tokens in 56 s (128.0 tok/s), expert cache 93.9% hit
RAM: 51% (47.8 / 95.4 GB)
Suggested fix: The PLE admission policy should consider the ratio of
(table + arena + headroom) to available RAM, and decline to admit when
the margin is too thin (e.g., <10% of available RAM remaining). On systems
with ample RAM (128+ GB), the table would still be admitted as before.
Reproduction status: Reproduced locally with Q2_0; same code path
confirmed for IQ2_XS, IQ3_XXS, IQ3_S by reading ple_residency.hpp
and the arena sizes in setup.py MODELS dict.