[GH-ISSUE #3734] In-place GGUF expert pages stay GPU-pinned on top of the resident pool (~2x expert RAM); posix_fadvise(DONTNEED) frees 0 - blocks lend coverage (#669) on 128 GB boxes #1564

Closed
opened 2026-11-04 01:52:17 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @bobgitmcgrath on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3734

Environment

  • Engine: strata-0.1.47-dual (v0.2.2-era source build), serve/server.py
  • OS / kernel: Ubuntu, kernel 6.8.0-146-generic
  • Hardware: Radeon Pro W7800 48 GB (gfx1100) primary + Radeon 8060S iGPU (gfx1151) peer (--peer-device 1, experts in GTT/system RAM); 121 GiB usable system RAM
  • Models: Qwen3.8-Flash-Next UD-Q5_K_XL (Unsloth, 6 shards, 158.3 GB; experts 91.6 GiB) and UD-IQ4_XS (experts ~55.4 GiB); packs via tools/iq_pack.py (native_experts v4) referencing the GGUF shards in place

Summary

When serving a pack whose experts are read in place from the native GGUF shards, the engine's expert file pages accumulate as non-reclaimable memory on top of the --resident-budget-gib page-locked pool — roughly doubling the expert RAM footprint. posix_fadvise(POSIX_FADV_DONTNEED) across all shards frees nothing, so the pages are pinned/dma-mapped rather than ordinary cache. On a 128 GB unified box this forces --resident-budget-gib below the lend-coverage threshold (#669), which turns 50K+-token prompts into SSD streams.

Measurements (30-s audit series, five windows, load → battery → restore)

UD-Q5_K_XL, --resident-budget-gib 48, steady state under load:

Field Value
MemTotal 121.2 GiB
MemAvailable 9–11 GiB
Shmem (page-locked pool, GTT-mapped: peer gtt_used 55.6 GB) ~51.7 GiB
Cached — excluded from MemAvailable (in-place GGUF pages) ~62–65 GiB
AnonPages ~2–3 GiB
Engine VmRSS / RssFile ~87 GiB / ~26–29 GiB
Mlocked / Unevictable (meminfo) 0 / 64 MiB — the pinning does not show up here

UD-IQ4_XS (production, same pattern, smaller): engine RssFile 29.1 GB with MemAvailable ~66 GiB — comfortable only because the model is smaller.

The fadvise test

After a full Q5 load (MemAvailable 4 GiB at that moment):

posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) on all six shards:
MemAvailable 4 -> 4 GiB (jump 0), Cached 62 -> 61 GiB

No meaningful release — consistent with the pages being mapped/pinned for GPU access rather than plain page cache.

Impact

  • Effective expert RAM cost ≈ pool + in-place copy (~2×). On Q5-class packs the box sits 3–9 GiB from the OOM floor under load.
  • The budget that fits (48) leaves the lend region fully uncovered — the engine reports 1001 of 1001 lendable slots (100%) will read their experts from the pack during a long prompt (#669) — so 50K+-token prompts stream experts from SSD (~206 tok/s prompt reads measured).
  • Raising the budget to cover the lend region (54 → 65 % covered, 56–58 → full) drops MemAvailable to 3–4 GiB and trips OOM-floor guards; --conversation-cache-min-free-mib throttling kicks in constantly.

Asks

  1. Release the in-place GGUF pages after the pool/VRAM copies are made (fadvise/madvise(DONTNEED) on the mapped ranges once a blob is resident), or
  2. a pack-only serving mode that does not retain the native GGUF mapping after load (the v4 pack already carries the index/offsets), or
  3. an explicit cap/knob for in-place page retention so the budget maths above can close on 128 GB boxes.

Any of these would let UD-Q5_K_XL run with full lend coverage on this class of machine; today the choice is uncovered lend (slow 50K+ prompts) or OOM-floor instability.

Evidence available

Full 30-s audit series (meminfo incl. Shmem/Mlocked/Unevictable/Cached/AnonPages/Swap, per-card sysfs mem_info_vram_used/mem_info_gtt_used, engine VmRSS/VmLck/RssAnon/RssFile) across five windows, plus engine logs showing the #669 lend lines at budgets 48/54. Happy to attach.

Originally created by @bobgitmcgrath on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3734 ### Environment - **Engine:** `strata-0.1.47-dual` (v0.2.2-era source build), `serve/server.py` - **OS / kernel:** Ubuntu, kernel 6.8.0-146-generic - **Hardware:** Radeon Pro W7800 48 GB (gfx1100) primary + Radeon 8060S iGPU (gfx1151) peer (`--peer-device 1`, experts in GTT/system RAM); 121 GiB usable system RAM - **Models:** Qwen3.8-Flash-Next **UD-Q5_K_XL** (Unsloth, 6 shards, 158.3 GB; experts 91.6 GiB) and **UD-IQ4_XS** (experts ~55.4 GiB); packs via `tools/iq_pack.py` (native_experts v4) referencing the GGUF shards in place ### Summary When serving a pack whose experts are read **in place from the native GGUF shards**, the engine's expert file pages accumulate as **non-reclaimable memory on top of** the `--resident-budget-gib` page-locked pool — roughly doubling the expert RAM footprint. `posix_fadvise(POSIX_FADV_DONTNEED)` across all shards frees **nothing**, so the pages are pinned/dma-mapped rather than ordinary cache. On a 128 GB unified box this forces `--resident-budget-gib` below the lend-coverage threshold (#669), which turns 50K+-token prompts into SSD streams. ### Measurements (30-s audit series, five windows, load → battery → restore) UD-Q5_K_XL, `--resident-budget-gib 48`, steady state under load: | Field | Value | |---|---| | MemTotal | 121.2 GiB | | **MemAvailable** | **9–11 GiB** | | Shmem (page-locked pool, GTT-mapped: peer `gtt_used` 55.6 GB) | ~51.7 GiB | | Cached — **excluded from MemAvailable** (in-place GGUF pages) | ~62–65 GiB | | AnonPages | ~2–3 GiB | | Engine VmRSS / RssFile | ~87 GiB / ~26–29 GiB | | Mlocked / Unevictable (meminfo) | 0 / 64 MiB — the pinning does **not** show up here | UD-IQ4_XS (production, same pattern, smaller): engine RssFile **29.1 GB** with MemAvailable ~66 GiB — comfortable only because the model is smaller. ### The fadvise test After a full Q5 load (MemAvailable 4 GiB at that moment): ``` posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) on all six shards: MemAvailable 4 -> 4 GiB (jump 0), Cached 62 -> 61 GiB ``` No meaningful release — consistent with the pages being mapped/pinned for GPU access rather than plain page cache. ### Impact - Effective expert RAM cost ≈ pool + in-place copy (~2×). On Q5-class packs the box sits 3–9 GiB from the OOM floor under load. - The budget that fits (`48`) leaves the lend region fully uncovered — the engine reports `1001 of 1001 lendable slots (100%) will read their experts from the pack during a long prompt` (#669) — so 50K+-token prompts stream experts from SSD (~206 tok/s prompt reads measured). - Raising the budget to cover the lend region (`54` → 65 % covered, `56–58` → full) drops MemAvailable to 3–4 GiB and trips OOM-floor guards; `--conversation-cache-min-free-mib` throttling kicks in constantly. ### Asks 1. **Release the in-place GGUF pages after the pool/VRAM copies are made** (fadvise/madvise(DONTNEED) on the mapped ranges once a blob is resident), or 2. a **pack-only serving mode** that does not retain the native GGUF mapping after load (the v4 pack already carries the index/offsets), or 3. an explicit **cap/knob for in-place page retention** so the budget maths above can close on 128 GB boxes. Any of these would let UD-Q5_K_XL run with full lend coverage on this class of machine; today the choice is uncovered lend (slow 50K+ prompts) or OOM-floor instability. ### Evidence available Full 30-s audit series (meminfo incl. Shmem/Mlocked/Unevictable/Cached/AnonPages/Swap, per-card sysfs `mem_info_vram_used`/`mem_info_gtt_used`, engine VmRSS/VmLck/RssAnon/RssFile) across five windows, plus engine logs showing the #669 lend lines at budgets 48/54. Happy to attach.
bsakaguchi 2026-11-04 01:52:17 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 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:6342850558 --> @github-actions[bot] commented on GitHub (Oct 22, 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

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

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6466832250 --> @github-actions[bot] commented on GitHub (Oct 28, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1564
No description provided.