[GH-ISSUE #4474] [Engine] v0.2.7.1 / engine 0.1.53: Excessive memory usage causes VRAM exhaustion and frequent request overflows #1999

Closed
opened 2026-11-04 01:55:53 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @janelu9 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4474

v0.2.7.1 / engine 0.1.53: memory use has grown a lot — VRAM runs dry (0 MiB free) and requests constantly overflow

Summary

After upgrading to Control v0.2.7.1 with the local engine 0.1.53, the engine no longer fits in a 16 GB RTX 5080 the way the previous version did. The startup expert-cache auto-sizing overshoots the --vram-reserve-mib budget, and during serving the card is regularly found to have 0–264 MiB free at the start of a request, which triggers your own #2065 paging path (decode drops, windows stall). Host-side, the PLE table mlock now fails on every start.

Environment

Item Value
OS Windows 11 Pro 10.0.26200, WSL2 (Ubuntu 22.04.5 LTS, kernel 6.18.33.2-microsoft-standard-WSL2)
CPU AMD Ryzen 9 9950X3D (16C/32T)
RAM 96 GB physical; WSL2 limit 91.7 GiB
GPU NVIDIA GeForce RTX 5080 (16 GB), CUDA 13, built for arch sm_120
Strata Control v0.2.7.1 (git tag v0.2.7.1, commit 46c152a, PRODUCT_VERSION = "0.2.7")
Engine 0.1.53 (engine BUILD.json: version 0.1.53, archs [120], src 7a4844f3e4e4f80a)
Model Qwen3.8-Flash-Next GSQ-RCO IQ3_S (2-file GGUF + PLE gguf), --max-context 262144 --kv int8 --spec 4 --mtp rt --vision --vram-reserve-mib 700 --expert-cache auto --pool-workers 10 --control-vector-scaled …

What I observe

  1. Startup sizing overshoots the reserve, then thrashes. In one process the same sizing pass logs both lines, in this order:

    strata generate: expert cache auto: 7.62 GiB free, 700 MiB reserved (+218 MiB for the draft head) -> 2712 slots
    strata generate: expert cache 3514 slots, 6.72 GiB of VRAM; policy is
    

    i.e. it grows from 2712 to 3514 slots, well past the 700 MiB reserve. On the next start it instead has to undo it:

    strata generate: only 0 MiB free once the slots are written (reserve 700 MiB); shrinking the expert cache
    strata generate: expert cache 2987 slots, 5.72 GiB of VRAM; policy is
    

    Across consecutive restarts with identical args, "VRAM free with everything loaded" swings between 101 MiB and 1144 MiB (101 / 1082 / 331 / 1144 …) — the sizing is not reproducible run to run, and at 101 MiB the engine itself warns LOW: requests may stall.

  2. During serving the card is constantly full. 44 occurrences in one log file:

    strata serve: WARNING: only 0 MiB of VRAM free at the start of this request (below 512 MiB): … (#2065). Add --vram-reserve-mib 1216 …
    

    Values go as low as 0 MiB even though the config asks for --vram-reserve-mib 700. Following the engine's own advice and raising the reserve just shrinks the expert cache and the card still ends up dry a few windows later.

  3. Host-side mlock now fails on every start:

    strata: PLE table mlock failed (Cannot allocate memory; raise `ulimit -l`): its pages stay faulted in but may be reclaimed
    

    (Host RAM is not the bottleneck — the memory guard reports 89+ GiB available — it looks like the locked-memory limit vs. the PLE table size.)

  4. Once the engine died before the launcher marked it ready: RuntimeError: the engine exited before it was ready.

Expected vs actual

  • Expected: with --vram-reserve-mib 700 and --expert-cache auto, the total footprint (weights + KV int8 + MTP draft 950 MiB + expert cache) should respect the reserve, size deterministically, and leave requests above the 512 MiB paging floor.
  • Actual: the auto-sizing overshoots the reserve within the same process, the footprint varies between restarts, and requests routinely start at 0–264 MiB free, so the previous version's model+config now sits right on the OOM edge.

Questions

  • Did the expert-cache slot sizing or the MTP/control-vector/resident-pack accounting change in 0.1.53 in a way that makes auto ignore --vram-reserve-mib during expansion?
  • Is the ulimit -l bump the intended fix for the PLE mlock failure now, or should the engine fall back more gracefully?

Happy to provide the full strata-iq3_s.log (≈30k lines) or rerun with any flags you'd like.

Originally created by @janelu9 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4474 # v0.2.7.1 / engine 0.1.53: memory use has grown a lot — VRAM runs dry (0 MiB free) and requests constantly overflow ## Summary After upgrading to Control **v0.2.7.1** with the local **engine 0.1.53**, the engine no longer fits in a 16 GB RTX 5080 the way the previous version did. The startup expert-cache auto-sizing overshoots the `--vram-reserve-mib` budget, and during serving the card is regularly found to have **0–264 MiB free at the start of a request**, which triggers your own #2065 paging path (decode drops, windows stall). Host-side, the PLE table `mlock` now fails on every start. ## Environment | Item | Value | |---|---| | OS | Windows 11 Pro 10.0.26200, WSL2 (Ubuntu 22.04.5 LTS, kernel 6.18.33.2-microsoft-standard-WSL2) | | CPU | AMD Ryzen 9 9950X3D (16C/32T) | | RAM | 96 GB physical; WSL2 limit 91.7 GiB | | GPU | NVIDIA GeForce RTX 5080 (16 GB), CUDA 13, built for arch sm_120 | | Strata Control | v0.2.7.1 (git tag `v0.2.7.1`, commit `46c152a`, `PRODUCT_VERSION = "0.2.7"`) | | Engine | 0.1.53 (engine `BUILD.json`: version `0.1.53`, archs `[120]`, src `7a4844f3e4e4f80a`) | | Model | Qwen3.8-Flash-Next GSQ-RCO IQ3_S (2-file GGUF + PLE gguf), `--max-context 262144 --kv int8 --spec 4 --mtp rt --vision --vram-reserve-mib 700 --expert-cache auto --pool-workers 10 --control-vector-scaled …` | ## What I observe 1. **Startup sizing overshoots the reserve, then thrashes.** In one process the same sizing pass logs both lines, in this order: ``` strata generate: expert cache auto: 7.62 GiB free, 700 MiB reserved (+218 MiB for the draft head) -> 2712 slots strata generate: expert cache 3514 slots, 6.72 GiB of VRAM; policy is ``` i.e. it grows from 2712 to 3514 slots, well past the 700 MiB reserve. On the next start it instead has to undo it: ``` strata generate: only 0 MiB free once the slots are written (reserve 700 MiB); shrinking the expert cache strata generate: expert cache 2987 slots, 5.72 GiB of VRAM; policy is ``` Across consecutive restarts with identical args, "VRAM free with everything loaded" swings between **101 MiB and 1144 MiB** (101 / 1082 / 331 / 1144 …) — the sizing is not reproducible run to run, and at 101 MiB the engine itself warns `LOW: requests may stall`. 2. **During serving the card is constantly full.** 44 occurrences in one log file: ``` strata serve: WARNING: only 0 MiB of VRAM free at the start of this request (below 512 MiB): … (#2065). Add --vram-reserve-mib 1216 … ``` Values go as low as 0 MiB even though the config asks for `--vram-reserve-mib 700`. Following the engine's own advice and raising the reserve just shrinks the expert cache and the card still ends up dry a few windows later. 3. **Host-side mlock now fails on every start:** ``` strata: PLE table mlock failed (Cannot allocate memory; raise `ulimit -l`): its pages stay faulted in but may be reclaimed ``` (Host RAM is not the bottleneck — the memory guard reports 89+ GiB available — it looks like the locked-memory limit vs. the PLE table size.) 4. Once the engine died before the launcher marked it ready: `RuntimeError: the engine exited before it was ready`. ## Expected vs actual - **Expected:** with `--vram-reserve-mib 700` and `--expert-cache auto`, the total footprint (weights + KV int8 + MTP draft 950 MiB + expert cache) should respect the reserve, size deterministically, and leave requests above the 512 MiB paging floor. - **Actual:** the auto-sizing overshoots the reserve within the same process, the footprint varies between restarts, and requests routinely start at 0–264 MiB free, so the previous version's model+config now sits right on the OOM edge. ## Questions - Did the expert-cache slot sizing or the MTP/control-vector/resident-pack accounting change in 0.1.53 in a way that makes `auto` ignore `--vram-reserve-mib` during expansion? - Is the `ulimit -l` bump the intended fix for the PLE `mlock` failure now, or should the engine fall back more gracefully? Happy to provide the full `strata-iq3_s.log` (≈30k lines) or rerun with any flags you'd like.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 28, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6471294894 --> @github-actions[bot] commented on GitHub (Oct 28, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@Sorohna commented on GitHub (Oct 28, 2026):

strata-coder-iq1_m_022.log
strata-coder-iq1_m_026.log
strata-coder-iq1_m_027.log
strata-coder-iq1_m_0144.log

'afternoon .. same issue this morning while testing 0.2.7

CPU: i9-9900X / 128GB RAM
GPU: RTX 4090 24 GB VRAM
Engine: 0.1.52 / Strata 0.2.7
Model: Qwen3.8-Flash-Next Coder IQ1_M

--expert-cache auto
--vram-reserve-mib 1024
--max-context 524288
--kv int8
--kv-resident 32768

Auto sizing: 6254 slots
Actual cache: 8146 slots
Expert cache: 15.51 GiB
Final free VRAM: 760 MiB

The engine has crashed, and takes long to automatically recover (~15min) (( Free memory: 0 / SWAP: 8GB Full ))
Immediately beforehand, Strata was processing prompts around 187K tokens and was still generating responses.

Note1: I have set STRATA_DEFAULTS=026 because 0.2.7 performance are really ugly compared to previous releases at least until 0.2.2/0.1.47

Note2: I was trying --vram-reserve-mib 1024 to try to solve numerous warnings in engine logs :
WARNING: only 434 MiB of VRAM free at the start of this request
(below 512 MiB)
Note2b: Observed since 0ct 13th / Strata 0.1.44

Regards

<!-- gh-comment-id:6471748955 --> @Sorohna commented on GitHub (Oct 28, 2026): [strata-coder-iq1_m_022.log](https://github.com/user-attachments/files/34085461/strata-coder-iq1_m_022.log) [strata-coder-iq1_m_026.log](https://github.com/user-attachments/files/34085460/strata-coder-iq1_m_026.log) [strata-coder-iq1_m_027.log](https://github.com/user-attachments/files/34085459/strata-coder-iq1_m_027.log) [strata-coder-iq1_m_0144.log](https://github.com/user-attachments/files/34085458/strata-coder-iq1_m_0144.log) 'afternoon .. same issue this morning while testing 0.2.7 CPU: i9-9900X / 128GB RAM GPU: RTX 4090 24 GB VRAM Engine: 0.1.52 / Strata 0.2.7 Model: Qwen3.8-Flash-Next Coder IQ1_M --expert-cache auto --vram-reserve-mib 1024 --max-context 524288 --kv int8 --kv-resident 32768 Auto sizing: 6254 slots Actual cache: 8146 slots Expert cache: 15.51 GiB Final free VRAM: 760 MiB The engine has crashed, and takes long to automatically recover (~15min) (( Free memory: 0 / SWAP: 8GB Full )) Immediately beforehand, Strata was processing prompts around 187K tokens and was still generating responses. Note1: I have set STRATA_DEFAULTS=026 because 0.2.7 performance are really ugly compared to previous releases at least until 0.2.2/0.1.47 Note2: I was trying --vram-reserve-mib 1024 to try to solve numerous warnings in engine logs : WARNING: only 434 MiB of VRAM free at the start of this request (below 512 MiB) Note2b: Observed since 0ct 13th / Strata 0.1.44 Regards
Author
Owner

@github-actions[bot] commented on GitHub (Oct 29, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6485744994 --> @github-actions[bot] commented on GitHub (Oct 29, 2026): Thanks, this follows the format now.
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

The jump from 2712 to 3514 slots is the same bytes (the auto count is in slots of the largest expert; the second pass packs the real, smaller blobs), and PLE table mlock failed is the fallback working.

What we reproduced (Linux, RTX A4000, 256K, --vram-reserve-mib 700): the card ends 241 MiB under the reserve, because about 245 MiB (cuBLAS handles, prompt-path and verifier modules) are allocated after the cache and priced by nothing. Fixed on our side; the fix ships in the next update (0.2.8). The automatic cache now leaves the reserve plus 256 MiB: 715 MiB free instead of 459, about 100 fewer slots, decode 62.55 against 63.15 tok/s.

Not reproduced: your swing of 101 to 1144 MiB between restarts. Please send the strata trace: lines (STRATA_TRACE=1) from two starts with different free figures.

<!-- gh-comment-id:6492062358 --> @Niko1221 commented on GitHub (Oct 29, 2026): The jump from 2712 to 3514 slots is the same bytes (the auto count is in slots of the largest expert; the second pass packs the real, smaller blobs), and `PLE table mlock failed` is the fallback working. What we reproduced (Linux, RTX A4000, 256K, `--vram-reserve-mib 700`): the card ends 241 MiB under the reserve, because about 245 MiB (cuBLAS handles, prompt-path and verifier modules) are allocated after the cache and priced by nothing. Fixed on our side; the fix ships in the next update (0.2.8). The automatic cache now leaves the reserve plus 256 MiB: 715 MiB free instead of 459, about 100 fewer slots, decode 62.55 against 63.15 tok/s. Not reproduced: your swing of 101 to 1144 MiB between restarts. Please send the `strata trace:` lines (`STRATA_TRACE=1`) from two starts with different free figures.
Author
Owner

@janelu9 commented on GitHub (Oct 29, 2026):

Reproduced the swing on 0.1.53 with STRATA_TRACE=1: two back-to-back starts, same binary and args, final free 858 MiB vs 0 MiB (20:37 and 20:45 local, WSL2 + RTX 5080, same args as above).

                              Start 1   Start 2
after CUDA context + arena     13377     13377   <- identical at process start: the card itself is NOT the source
after the pack weights         13377     13377
after session (KV, GDN, PLE)    7393      7393   <- byte-identical up to here
after the native head           3170      5791   <- first divergence: transient native-head allocations freed at different points
after w+session+drafter         5791      5791   <- converge again
after opening the cache          835       707   <- the cache sizes differently from the same 5791 input
after the prompt path           1154       296   <- largest divergence: Start 1 net-FREES 319 MiB, Start 2 net-ALLOCATES 407
after verifier binding           858         0   <- both take exactly 296 MiB here

So the different free figures are not the VRAM presented at process start (identical in both runs) — the swing is amplified inside the startup path itself: the native-head phase leaves different amounts resident at the marks, the expert cache then sizes from that, and the prompt-path/cuBLAS allocations move in opposite directions (net free vs net allocate) — consistent with those allocations sizing themselves against whatever free they find at their moment, feeding back against the cache. The verifier step's 296 MiB was identical in both runs, matching the ~245 you priced in the 0.2.8 fix.

Happy to rerun on the 0.2.8 build when it ships. One follow-up question while you're in there: does the native-head transient also get marked (or avoided) by the fix, or only the prompt-path/verifier cost? That transient is where the run-to-run difference first appears.

<!-- gh-comment-id:6498064629 --> @janelu9 commented on GitHub (Oct 29, 2026): Reproduced the swing on 0.1.53 with `STRATA_TRACE=1`: two back-to-back starts, same binary and args, final free **858 MiB vs 0 MiB** (20:37 and 20:45 local, WSL2 + RTX 5080, same args as above). ```text Start 1 Start 2 after CUDA context + arena 13377 13377 <- identical at process start: the card itself is NOT the source after the pack weights 13377 13377 after session (KV, GDN, PLE) 7393 7393 <- byte-identical up to here after the native head 3170 5791 <- first divergence: transient native-head allocations freed at different points after w+session+drafter 5791 5791 <- converge again after opening the cache 835 707 <- the cache sizes differently from the same 5791 input after the prompt path 1154 296 <- largest divergence: Start 1 net-FREES 319 MiB, Start 2 net-ALLOCATES 407 after verifier binding 858 0 <- both take exactly 296 MiB here ``` So the different free figures are not the VRAM presented at process start (identical in both runs) — the swing is amplified inside the startup path itself: the native-head phase leaves different amounts resident at the marks, the expert cache then sizes from that, and the prompt-path/cuBLAS allocations move in opposite directions (net free vs net allocate) — consistent with those allocations sizing themselves against whatever free they find at their moment, feeding back against the cache. The verifier step's 296 MiB was identical in both runs, matching the ~245 you priced in the 0.2.8 fix. Happy to rerun on the 0.2.8 build when it ships. One follow-up question while you're in there: does the native-head transient also get marked (or avoided) by the fix, or only the prompt-path/verifier cost? That transient is where the run-to-run difference first appears.
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

Fixed in 0.2.8: the automatic cache now leaves the reserve plus 256 MiB, because about 245 MiB is allocated after the cache and nothing counted it. On the A4000 at 256K that is 715 MiB free instead of 459, about 100 fewer slots, and decode at 62.55 against 63.15 tok/s. Run strata update. Closing. We could not reproduce the 101 to 1144 MiB swing you saw, so reopen with logs if it comes back.

<!-- gh-comment-id:6510319390 --> @Niko1221 commented on GitHub (Oct 29, 2026): Fixed in 0.2.8: the automatic cache now leaves the reserve plus 256 MiB, because about 245 MiB is allocated after the cache and nothing counted it. On the A4000 at 256K that is 715 MiB free instead of 459, about 100 fewer slots, and decode at 62.55 against 63.15 tok/s. Run `strata update`. Closing. We could not reproduce the 101 to 1144 MiB swing you saw, so reopen with logs if it comes back.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1999
No description provided.