[GH-ISSUE #4846] [Engine] Arena wait times out and the arena registers anyway with the PLE lock held: host stalls at raised context (#4518 give-back covers only the conversation cache) #2226

Open
opened 2026-11-04 01:57:41 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @eddietheengineer on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4846

Area

[Engine] — the PLE residency policy and the expert-arena load at startup.

Desktop app, Terminal or source?

Docker — the official CUDA 13 image (ghcr.io/niko1221/strata@sha256:83e37db8625c67b61c579fd7c0f9068f2d831037a937f139c569502b54290998, image 0.2.9, engine 0.1.55), stock setup.py flow inside it, driven by our launcher.

What happened

On a 92 GiB-RAM rig with the model on an NVMe SSD, booting Qwen3.8-Flash-Next IQ3_S at a raised --max-context 524288 (trained 262144, yarn ×2), auto policy (STRATA_PLE_AUTO_RAM empty/unset):

  1. The residency check admits the table — correctly by its own arithmetic (ple_resident_admit: table + arena ≤ available − an 8 GiB headroom; in the capture 73.6 ≤ 86.7 − 8 = 78.7, ~5.1 GiB to spare):
    strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.7 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them)
    strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 11.3 s
    
    (The policy, not our config, chose ram: the run config /data/install/strata-iq3_s.json and run-iq3_s.sh contain no --ple-io at all, and the logged engine argv has none.)
  2. Between the check and the arena fill, available RAM fell 86.7 → 33.66 GiB. The table lock itself accounts for 26.8 of that (which the check priced in); the rest of startup consumed ~26 GiB more — against the 8 GiB headroom the admission allowed, and ple_residency.hpp's own #4518 comment says exactly this window is invisible to the check ("what the rest of the engine takes after that (the KV pools, the pinned staging, the GPUs' host buffers) is not known then"). The boot's own lines itemize only part of the ~26 GiB (KV streaming pins 2.58 GiB; the batch slot sessions are in VRAM; the conversation cache is sized at serve time, after the arena) — the residual is unexplained from the log alone.
  3. When the arena comes up, the engine knows it cannot fit (clean capture, 18:07:45 UTC):
    strata generate: the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
    strata generate: the expert arena needs 46.84 GiB of RAM and 33.63 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
    
    In the earlier unwatchdogged incident (14:55:20 UTC, same config), the boot's block in the append-only log ends mid-wait at - 15 s so far; the next line is the next engine start at 15:09:17. The host journal's last entries are memory-pressure cache flushes at 14:56:20/14:56:22/14:56:48 UTC, with no shutdown sequence; the next boot starts at 15:00:02. The host had to be power-cycled. (Engine log timestamps are UTC; the journal prints local EDT = UTC-4.)
  4. The defect as we read it: at the wait point the engine already knows the arena does not fit (46.84 needed vs 33.66 available), yet when the 20 s wait expires it proceeds into the arena registration with the PLE lock still held — into a host stall. Earlier boots prove the registration happens regardless of how far the wait undershoots: after the - 15 s so far line the very next line is strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 1 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (#2126) (attached: registration-after-timeout-144344.log; other starved boots read 0 GiB). The #4518 give-back mechanism exists and works, but it fires at serve time against the conversation cache only; a starved boot never reaches serve.
  5. The same boot with STRATA_PLE_AUTO_RAM=0 (table on direct disk reads — on this SSD the probe says it's cheap: PLE direct read probe: 47431 rows/s (fine), 46.9–48.4k across the =0 boots) comes up clean and is our current serving config: loaded 46.84 GiB at 2.92 GiB/s, verify-stress ceiling ladder to 481K tokens, MemAvailable floor 6.7 GiB, zero swap.

Reproduction status

The sequence above was reproduced on demand under a watchdog that docker stops the container at the first arena-wait line, inside the 20 s window and before the arena registration — so the capture stops exactly where the dangerous step begins. clean-repro-boot.log is that boot in full (engine 0.1.55, 2026-10-31 18:07:45 UTC): memory guard 87.4 GiB → residency admit at 86.7 GiB → PLE table locked in RAM ... in 11.3 s → KV streaming pins 2.58 GiB → ... → the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s → - 5 s so far (container stopped there).

Before we understood the failure, the same failure mode — auto policy at a raised context — killed the host outright four times in one afternoon: three 1M-context boots (14:28:50, 14:35:02, 14:43:44 UTC, each logging the arena wait at 8.1–9.3 GiB available) and the 524288 boot (14:55:20, wait at 34.6 GiB), each followed within 1.4–3.8 min by a journal ending in Under memory pressure, flushing caches (one in rtkit-daemon: The canary thread is apparently starving) with no shutdown record; last journal entries 14:30:11, 14:38:50, 14:45:48, 14:56:48 UTC. (Journal timestamps after NTP sync are local EDT; add 4 h for UTC. Boot 0's early journal lines predate the NTP correction and read 07:00 — the real boot time, 15:00:02 UTC, is from uptime/who -b.) No starved boot ever logged loaded 46.84 GiB — only the =0 boots did. Those deaths are why we built the watchdog; the clean capture is the primary evidence, the journal history (journal-deaths.txt) shows it is not a one-off. The stall mechanism (direct reclaim/compaction during registration with the table locked) is inference by analogy with #3698 — we did not capture PSI/vmstat at the deaths.

Contrast with #3698: there MemAvailable over-reported because of KHO/CMA (CmaFree ~17 GiB counted as free). Here CmaTotal: 0 kB (kernel cmdline has crashkernel=…, no kho=) and swap is 8.0 GiB — MemAvailable was accurate at both readings; the RAM genuinely disappeared between the check and the fill.

Smallest steps or command that reproduce it

strata --serve --pack <iq3_s pack> --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf \
  --ple-gguf ...-00002-of-00002.gguf --expert-profile expert-profile.bin \
  --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <rt head> \
  --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 \
  --layer-split auto --batch 3

(2× sm_86, STRATA_PLE_AUTO_RAM empty/unset = auto policy.) Preconditions that matter: a fresh boot with ~87 GiB MemAvailable, model files on an SSD so setup leaves the table on direct reads (on a rotational disk setup writes --ple-io ram itself and the policy is not the decider), and the context raised past 262144 so the arena is the big late allocation.

⚠️ Unwatchdogged, auto-policy raised-context boots hung this 92 GiB host four times (three at 1M context, one at 524288 — see Reproduction status). The attached capture was taken with a watchdog stopping the container inside the 20 s wait, before registration.

Strata version

Image 0.2.9 / engine 0.1.55. #4518's give-back was fixed in 0.2.8 and is present here — it works for the conversation cache (we see it fire on this rig on earlier boots: PLE table lock given back: the lock left 4.5 GiB of RAM for the conversation cache, 30.7 GiB without it (the table stays cached; --conversation-cache-mib N and --ple-io ram are kept as asked)), but the incident boot never reached serve, where that check happens.

Graphics card, memory and system

RTX 3090 + RTX 3090 Ti (sm_86, PCIe, no NVLink), 91.9 GiB host RAM (capture boot's guard line: memory guard: limit 91.9 GiB (source: meminfo), current 4.5 GiB, reclaimable cache credited 0.0 GiB; available 87.4 GiB (MemAvailable 87.4 GiB), floor 2560 MiB), Ubuntu 26.04.1 kernel 7.0.0-38-generic, driver 615.71.09, model files on NVMe SSD (ext4, rotational=0), Docker 29.9.0, container with --ulimit memlock=-1, swap 8.0 GiB, CmaTotal: 0 kB.

Model, size and settings

Qwen3.8-Flash-Next IQ3_S (GSQ-RCO pack); PLE table 26.8 GiB (second GGUF shard), expert arena 46.84 GiB, --kv int8 --kv-resident 32768 --spec 4 --batch 3 --layer-split auto, --max-context 524288 --rope-scaling yarn --rope-scale 2.

The ask

When the arena wait expires and the arena still does not fit: give the PLE table lock back (the #4518 mechanism, applied at the arena-wait point against the arena instead of at serve time against the conversation cache) and retry the registration — or fail the start with a clear error — rather than registering into a host stall. The engine has both numbers at that moment; the current code waits 20 s and proceeds regardless. (Secondary: the admission prices table + arena against an 8 GiB headroom, but on our rig the rest of startup took ~26 GiB between the check and the fill; a MemAvailable re-check at the arena point, before registering, would have caught every starved boot above.)

Potential fix (from reading v0.2.9 — please correct us if we misread the design)

The pieces already exist; only the seam between them is missing:

  • PleTable::unlock() (src/kernels/ngram.cpp:522) is a clean, self-contained give-back: unlock_resident over the table range, locked = false; the mapping stays and reads keep going through it — only the page lock is dropped, so the OS may reclaim the pages and they fault back from the file (the #4518 log's "the table stays cached").
  • generate.cpp tracks ple_lock_by_policy (:4710, set at :4769) precisely so the policy's lock — and only the policy's lock, never a hand-asked --ple-io ram — may be given back. The #4518 site (:10413) calls ple_table.unlock() when the lock starves the conversation cache.
  • ArenaExpertSource::open() (src/core/expert_source.cpp:5777, the check at ~5864-5921) computes the shortfall before it registers: it waits (wait_for_ram), and if hm.available < need still holds, it sets ram_warning_ — whose own text says "with this little room the whole machine can stall in memory reclaim until it is restarted (#4051)" — and then proceeds to the cudaHostRegister slices anyway (:3944/:3987).

All three live in main()'s scope, so the warning and the unlock are visible to each other. The stall happens inside open() (the registration follows the warning in the same function), so the check can't just move to the call site. Minimal shape we'd suggest: hand the arena source a give-back hook — e.g. a std::function<void()> ple_give_back parameter (or the PleTable* + the ple_lock_by_policy flag, as the #4518 site already pairs them) — and call it where ram_warning_ is set when the shortfall survives the wait (hm.available < need), then re-read available_host_bytes() before the registration slices begin. Log line in the #4518 style: strata generate: PLE table lock given back: the expert arena needs %.2f GiB and only %.2f GiB is available (the table stays cached; --ple-io ram asked for by hand is kept). Roughly 30-50 lines plus a ple_residency_test.cpp case; no new state, no reordering of the load.

Note the warning text reserves "the whole machine can stall in memory reclaim" for hm.available < need / 2 — our 512K hang happened at 33.66 available against 46.84 needed, above that threshold (the 1M boots were below it). If the stall clause is the intended trigger, the threshold under-prices the risk on a 92 GiB host; giving back on any surviving shortfall is the safer rule, and costs the 2-3% lock benefit only on boots that would otherwise stall.

We recognize the recommend-not-force rule the wait's comment cites ("the load then goes on either way - it only warns") — this narrows the exception to the case where the engine's own warning text already predicts a machine stall, and gives back a lock the policy (not the user) took, which is the same trade #4518 made for the conversation cache: the lock is worth 2-3% of prompt speed, the host is worth more.

Context

Filed from the club-3090 project (we vendor Strata in our catalog; open PR #1888 forwards STRATA_PLE_AUTO_RAM as a launch workaround on all five Strata composes and documents the two RAM paths). Happy to run any instrumented build on this rig.

Logs

clean-repro-boot.log — the primary watchdogged capture (2026-10-31 18:07:45 UTC, container stopped at the arena wait):

[strata] 2026-10-31 18:07:45 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --layer-split auto --batch 3
strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS
strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 4.5 GiB, reclaimable cache credited 0.0 GiB; available 87.4 GiB (MemAvailable 87.4 GiB), floor 2560 MiB
strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto)
strata generate: PCIe probe: 24.8 GB/s host->device (best of 24.8 24.8 24.8 24.8) -> pcie_frac 0.55 (default 0.55)
strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
strata generate: rope scaling yarn, factor 2 (freq_scale 0.5, base 1e+07, mscale 1.069315), --max-context 524288 against a trained context of 262144
strata generate: note: the YaRN magnitude correction scales cos and sin by 1.069315 at every position
strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s)
strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.7 s (302 canonical tensors skipped: served natively)
strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.8 s
strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.7 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them)
strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 11.3 s
strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.7 6.7 6.7) -> pcie_frac 0.18
strata generate: layer split: CUDA1 holds its weights; 19.59 GiB free (its session follows the split search)
strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots
strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve
strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.84 GiB free before its session carve
strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00
strata generate: layer split auto: CUDA1 link 6.7 GB/s -> miss cost x1.00
strata generate: layer split auto: K=20 - predicted 24.5 ms per decode window; the caches hold 18742 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements
strata generate: layer split auto: NEAR TIE - K=23 is predicted 24.6 ms per decode window, within 0.5% of K=20 (24.5 ms); the cards differ, so the prediction may not rank them (it prices decode, not the prompt). To try the other: --layer-split 23
strata generate: KV streaming: 32768 of 524288 cells per QSA layer in VRAM, the K/V in 2.58 GiB of pinned RAM
strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf
strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 18.23 GiB free
strata generate: --batch-groups auto: 1 group of 3 slots
strata generate: --batch: 3 slot sessions on CUDA0 (0.66 GiB each); 16.97 GiB free
strata generate: --batch: 3 slot sessions on CUDA1 (0.87 GiB each); 15.59 GiB free
strata generate: --batch 3: the slot sessions take 1.97 GiB of VRAM on CUDA0 that the expert cache would otherwise hold
strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.58 s (1360 MiB/s)
strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6
strata generate: the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 33.63 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this)

registration-after-timeout-144344.log — an unwatchdogged 1M boot: the wait expires and the registration line follows immediately:

[strata] 2026-10-31 14:43:44 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 1048576 --kv int8 --kv-resident 32768 --rope-scaling yarn --rope-scale 4 --layer-split auto --batch 3
strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS
strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 4.2 GiB, reclaimable cache credited 0.0 GiB; available 87.6 GiB (MemAvailable 87.6 GiB), floor 2560 MiB
strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto)
strata generate: PCIe probe: 24.9 GB/s host->device (best of 24.7 24.9 24.7 24.8) -> pcie_frac 0.55 (default 0.55)
strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
strata generate: rope scaling yarn, factor 4 (freq_scale 0.25, base 1e+07, mscale 1.138629), --max-context 1048576 against a trained context of 262144
strata generate: note: the YaRN magnitude correction scales cos and sin by 1.138629 at every position
strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s)
strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.6 s (302 canonical tensors skipped: served natively)
strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.8 s
strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 87.0 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them)
strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 13.0 s
strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.7 6.7 6.7) -> pcie_frac 0.18
strata generate: layer split: CUDA1 holds its weights; 19.61 GiB free (its session follows the split search)
strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots
strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve
strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.86 GiB free before its session carve
strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00
strata generate: layer split auto: CUDA1 link 6.6 GB/s -> miss cost x1.00
strata generate: layer split auto: K=20 - predicted 24.6 ms per decode window; the caches hold 18219 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements
strata generate: KV streaming: 32768 of 1048576 cells per QSA layer in VRAM, the K/V in 5.16 GiB of pinned RAM
strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf
strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 17.66 GiB free
strata generate: --batch-groups auto: 1 group of 3 slots
strata generate: --batch: 3 slot sessions on CUDA0 (1.10 GiB each); 15.17 GiB free
strata generate: --batch: 3 slot sessions on CUDA1 (1.43 GiB each); 13.28 GiB free
strata generate: --batch 3: the slot sessions take 3.30 GiB of VRAM on CUDA0 that the expert cache would otherwise hold
strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.68 s (1149 MiB/s)
strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6
strata generate: the expert arena needs 46.84 GiB of RAM and 8.56 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 8.62 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 8.65 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 10 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 8.70 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 15 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 1 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (STRATA_ARENA_THP=1 requests them anyway) (#2126)

incident-boot-145520.log — the 524288 boot quoted in step 3, ending mid-wait at '- 15 s so far'; the host died minutes later:

[strata] 2026-10-31 14:55:20 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --layer-split auto --batch 3
strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS
strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 3.9 GiB, reclaimable cache credited 0.0 GiB; available 88.0 GiB (MemAvailable 88.0 GiB), floor 2560 MiB
strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto)
strata generate: PCIe probe: 24.8 GB/s host->device (best of 24.8 24.8 24.8 24.8) -> pcie_frac 0.55 (default 0.55)
strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
strata generate: rope scaling yarn, factor 2 (freq_scale 0.5, base 1e+07, mscale 1.069315), --max-context 524288 against a trained context of 262144
strata generate: note: the YaRN magnitude correction scales cos and sin by 1.069315 at every position
strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s)
strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.3 s (302 canonical tensors skipped: served natively)
strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.3 s
strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 87.4 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them)
strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 0.5 s
strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.6 6.7 6.7) -> pcie_frac 0.18
strata generate: layer split: CUDA1 holds its weights; 19.59 GiB free (its session follows the split search)
strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots
strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve
strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.84 GiB free before its session carve
strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00
strata generate: layer split auto: CUDA1 link 6.7 GB/s -> miss cost x1.00
strata generate: layer split auto: K=20 - predicted 24.5 ms per decode window; the caches hold 18741 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements
strata generate: layer split auto: NEAR TIE - K=23 is predicted 24.6 ms per decode window, within 0.5% of K=20 (24.5 ms); the cards differ, so the prediction may not rank them (it prices decode, not the prompt). To try the other: --layer-split 23
strata generate: KV streaming: 32768 of 524288 cells per QSA layer in VRAM, the K/V in 2.58 GiB of pinned RAM
strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf
strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 18.23 GiB free
strata generate: --batch-groups auto: 1 group of 3 slots
strata generate: --batch: 3 slot sessions on CUDA0 (0.66 GiB each); 16.97 GiB free
strata generate: --batch: 3 slot sessions on CUDA1 (0.87 GiB each); 15.59 GiB free
strata generate: --batch 3: the slot sessions take 1.97 GiB of VRAM on CUDA0 that the expert cache would otherwise hold
strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.37 s (2099 MiB/s)
strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6
strata generate: the expert arena needs 46.84 GiB of RAM and 34.60 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 34.67 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 34.70 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 10 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
strata generate: the expert arena needs 46.84 GiB of RAM and 34.78 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 15 s so far (STRATA_ARENA_RAM_WAIT_S changes this)

journal-deaths.txt — host journal: last lines of the four dead boots, boot 0's first line, meminfo (Cma/Swap):

Oct 31 10:29:08 aipc systemd[1]: systemd-timedated.service: Deactivated successfully.
Oct 31 10:30:11 aipc rtkit-daemon[3142]: The canary thread is apparently starving. Taking action.
Oct 31 10:38:29 aipc rtkit-daemon[2844]: Demoted 1 threads.
Oct 31 10:38:50 aipc systemd-journald[609]: Under memory pressure, flushing caches.
Oct 31 10:45:48 aipc systemd-journald[633]: Under memory pressure, flushing caches.
Oct 31 10:45:48 aipc systemd-resolved[671]: Under memory pressure, flushing caches.
Oct 31 10:56:48 aipc systemd-journald[637]: Under memory pressure, flushing caches.
Oct 31 10:56:22 aipc systemd-resolved[676]: Under memory pressure, flushing caches.
--- boot0 first:
Oct 31 07:00:02 aipc kernel: Linux version 7.0.0-38-generic (buildd@lcy02-amd64-070) (x86_64-linux-gnu-gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.46) #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep  4 09:10:14 UTC 2026 (Ubuntu 7.0.0-38.38-generic 7.0.14)
--- meminfo:
SwapTotal:       8388604 kB
CmaTotal:              0 kB
CmaFree:               0 kB

How the clean capture was taken safely: a watchdog tails the engine log, and at the first expert arena needs ... is available line runs switch.sh --down — inside the 20 s wait, before the arena registration. The script is in our repo scratch; happy to share it.

Originally created by @eddietheengineer on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4846 ### Area [Engine] — the PLE residency policy and the expert-arena load at startup. ### Desktop app, Terminal or source? Docker — the official CUDA 13 image (`ghcr.io/niko1221/strata@sha256:83e37db8625c67b61c579fd7c0f9068f2d831037a937f139c569502b54290998`, image 0.2.9, engine 0.1.55), stock `setup.py` flow inside it, driven by our launcher. ### What happened On a 92 GiB-RAM rig with the model on an NVMe SSD, booting Qwen3.8-Flash-Next IQ3_S at a raised `--max-context 524288` (trained 262144, yarn ×2), auto policy (`STRATA_PLE_AUTO_RAM` empty/unset): 1. The residency check admits the table — correctly by its own arithmetic (`ple_resident_admit`: table + arena ≤ available − an 8 GiB headroom; in the capture 73.6 ≤ 86.7 − 8 = 78.7, ~5.1 GiB to spare): ``` strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.7 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them) strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 11.3 s ``` (The policy, not our config, chose `ram`: the run config `/data/install/strata-iq3_s.json` and `run-iq3_s.sh` contain no `--ple-io` at all, and the logged engine argv has none.) 2. Between the check and the arena fill, available RAM fell 86.7 → 33.66 GiB. The table lock itself accounts for 26.8 of that (which the check priced in); the rest of startup consumed ~26 GiB more — against the 8 GiB headroom the admission allowed, and `ple_residency.hpp`'s own #4518 comment says exactly this window is invisible to the check ("what the rest of the engine takes after that (the KV pools, the pinned staging, the GPUs' host buffers) is not known then"). The boot's own lines itemize only part of the ~26 GiB (KV streaming pins 2.58 GiB; the batch slot sessions are in VRAM; the conversation cache is sized at serve time, after the arena) — the residual is unexplained from the log alone. 3. When the arena comes up, the engine knows it cannot fit (clean capture, 18:07:45 UTC): ``` strata generate: the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 33.63 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this) ``` In the earlier unwatchdogged incident (14:55:20 UTC, same config), the boot's block in the append-only log ends mid-wait at `- 15 s so far`; the next line is the next engine start at 15:09:17. The host journal's last entries are memory-pressure cache flushes at 14:56:20/14:56:22/14:56:48 UTC, with no shutdown sequence; the next boot starts at 15:00:02. The host had to be power-cycled. (Engine log timestamps are UTC; the journal prints local EDT = UTC-4.) 4. **The defect as we read it:** at the wait point the engine already knows the arena does not fit (46.84 needed vs 33.66 available), yet when the 20 s wait expires it proceeds into the arena registration with the PLE lock still held — into a host stall. Earlier boots prove the registration happens regardless of how far the wait undershoots: after the `- 15 s so far` line the very next line is `strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 1 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (#2126)` (attached: `registration-after-timeout-144344.log`; other starved boots read 0 GiB). The #4518 give-back mechanism exists and works, but it fires at serve time against the **conversation cache** only; a starved boot never reaches serve. 5. The same boot with `STRATA_PLE_AUTO_RAM=0` (table on direct disk reads — on this SSD the probe says it's cheap: `PLE direct read probe: 47431 rows/s (fine)`, 46.9–48.4k across the `=0` boots) comes up clean and is our current serving config: `loaded 46.84 GiB at 2.92 GiB/s`, verify-stress ceiling ladder to 481K tokens, MemAvailable floor 6.7 GiB, zero swap. ### Reproduction status The sequence above was reproduced on demand under a watchdog that `docker stop`s the container at the first arena-wait line, inside the 20 s window and before the arena registration — so the capture stops exactly where the dangerous step begins. `clean-repro-boot.log` is that boot in full (engine 0.1.55, 2026-10-31 18:07:45 UTC): memory guard 87.4 GiB → residency admit at 86.7 GiB → `PLE table locked in RAM ... in 11.3 s` → KV streaming pins 2.58 GiB → ... → `the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s` → `- 5 s so far` (container stopped there). Before we understood the failure, the same failure mode — auto policy at a raised context — killed the host outright four times in one afternoon: three 1M-context boots (14:28:50, 14:35:02, 14:43:44 UTC, each logging the arena wait at 8.1–9.3 GiB available) and the 524288 boot (14:55:20, wait at 34.6 GiB), each followed within 1.4–3.8 min by a journal ending in `Under memory pressure, flushing caches` (one in `rtkit-daemon: The canary thread is apparently starving`) with no shutdown record; last journal entries 14:30:11, 14:38:50, 14:45:48, 14:56:48 UTC. (Journal timestamps after NTP sync are local EDT; add 4 h for UTC. Boot 0's early journal lines predate the NTP correction and read 07:00 — the real boot time, 15:00:02 UTC, is from `uptime`/`who -b`.) No starved boot ever logged `loaded 46.84 GiB` — only the `=0` boots did. Those deaths are why we built the watchdog; the clean capture is the primary evidence, the journal history (`journal-deaths.txt`) shows it is not a one-off. The stall mechanism (direct reclaim/compaction during registration with the table locked) is inference by analogy with #3698 — we did not capture PSI/vmstat at the deaths. Contrast with #3698: there MemAvailable *over-reported* because of KHO/CMA (`CmaFree` ~17 GiB counted as free). Here `CmaTotal: 0 kB` (kernel cmdline has `crashkernel=…`, no `kho=`) and swap is 8.0 GiB — MemAvailable was accurate at both readings; the RAM genuinely disappeared between the check and the fill. ### Smallest steps or command that reproduce it ``` strata --serve --pack <iq3_s pack> --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf \ --ple-gguf ...-00002-of-00002.gguf --expert-profile expert-profile.bin \ --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <rt head> \ --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 \ --layer-split auto --batch 3 ``` (2× sm_86, `STRATA_PLE_AUTO_RAM` empty/unset = auto policy.) Preconditions that matter: a fresh boot with ~87 GiB MemAvailable, model files on an SSD so setup leaves the table on direct reads (on a rotational disk setup writes `--ple-io ram` itself and the policy is not the decider), and the context raised past 262144 so the arena is the big late allocation. ⚠️ **Unwatchdogged, auto-policy raised-context boots hung this 92 GiB host four times** (three at 1M context, one at 524288 — see Reproduction status). The attached capture was taken with a watchdog stopping the container inside the 20 s wait, before registration. ### Strata version Image 0.2.9 / engine 0.1.55. #4518's give-back was fixed in 0.2.8 and is present here — it works for the conversation cache (we see it fire on this rig on earlier boots: `PLE table lock given back: the lock left 4.5 GiB of RAM for the conversation cache, 30.7 GiB without it (the table stays cached; --conversation-cache-mib N and --ple-io ram are kept as asked)`), but the incident boot never reached serve, where that check happens. ### Graphics card, memory and system RTX 3090 + RTX 3090 Ti (sm_86, PCIe, no NVLink), 91.9 GiB host RAM (capture boot's guard line: `memory guard: limit 91.9 GiB (source: meminfo), current 4.5 GiB, reclaimable cache credited 0.0 GiB; available 87.4 GiB (MemAvailable 87.4 GiB), floor 2560 MiB`), Ubuntu 26.04.1 kernel 7.0.0-38-generic, driver 615.71.09, model files on NVMe SSD (ext4, `rotational=0`), Docker 29.9.0, container with `--ulimit memlock=-1`, swap 8.0 GiB, `CmaTotal: 0 kB`. ### Model, size and settings Qwen3.8-Flash-Next IQ3_S (GSQ-RCO pack); PLE table 26.8 GiB (second GGUF shard), expert arena 46.84 GiB, `--kv int8 --kv-resident 32768 --spec 4 --batch 3 --layer-split auto`, `--max-context 524288 --rope-scaling yarn --rope-scale 2`. ### The ask When the arena wait expires and the arena still does not fit: **give the PLE table lock back** (the #4518 mechanism, applied at the arena-wait point against the arena instead of at serve time against the conversation cache) and retry the registration — or fail the start with a clear error — rather than registering into a host stall. The engine has both numbers at that moment; the current code waits 20 s and proceeds regardless. (Secondary: the admission prices table + arena against an 8 GiB headroom, but on our rig the rest of startup took ~26 GiB between the check and the fill; a MemAvailable re-check at the arena point, before registering, would have caught every starved boot above.) ### Potential fix (from reading v0.2.9 — please correct us if we misread the design) The pieces already exist; only the seam between them is missing: - `PleTable::unlock()` (`src/kernels/ngram.cpp:522`) is a clean, self-contained give-back: `unlock_resident` over the table range, `locked = false`; the mapping stays and reads keep going through it — only the page lock is dropped, so the OS may reclaim the pages and they fault back from the file (the #4518 log's "the table stays cached"). - `generate.cpp` tracks `ple_lock_by_policy` (`:4710`, set at `:4769`) precisely so the policy's lock — and only the policy's lock, never a hand-asked `--ple-io ram` — may be given back. The #4518 site (`:10413`) calls `ple_table.unlock()` when the lock starves the conversation cache. - `ArenaExpertSource::open()` (`src/core/expert_source.cpp:5777`, the check at ~5864-5921) computes the shortfall **before** it registers: it waits (`wait_for_ram`), and if `hm.available < need` still holds, it sets `ram_warning_` — whose own text says "with this little room the whole machine can stall in memory reclaim until it is restarted (#4051)" — and then proceeds to the `cudaHostRegister` slices anyway (`:3944/:3987`). All three live in `main()`'s scope, so the warning and the unlock are visible to each other. The stall happens *inside* `open()` (the registration follows the warning in the same function), so the check can't just move to the call site. Minimal shape we'd suggest: hand the arena source a give-back hook — e.g. a `std::function<void()> ple_give_back` parameter (or the `PleTable*` + the `ple_lock_by_policy` flag, as the #4518 site already pairs them) — and call it where `ram_warning_` is set when the shortfall survives the wait (`hm.available < need`), then re-read `available_host_bytes()` before the registration slices begin. Log line in the #4518 style: `strata generate: PLE table lock given back: the expert arena needs %.2f GiB and only %.2f GiB is available (the table stays cached; --ple-io ram asked for by hand is kept)`. Roughly 30-50 lines plus a `ple_residency_test.cpp` case; no new state, no reordering of the load. Note the warning text reserves "the whole machine can stall in memory reclaim" for `hm.available < need / 2` — our 512K hang happened at 33.66 available against 46.84 needed, *above* that threshold (the 1M boots were below it). If the stall clause is the intended trigger, the threshold under-prices the risk on a 92 GiB host; giving back on any surviving shortfall is the safer rule, and costs the 2-3% lock benefit only on boots that would otherwise stall. We recognize the recommend-not-force rule the wait's comment cites ("the load then goes on either way - it only warns") — this narrows the exception to the case where the engine's own warning text already predicts a machine stall, and gives back a lock the policy (not the user) took, which is the same trade #4518 made for the conversation cache: the lock is worth 2-3% of prompt speed, the host is worth more. ### Context Filed from the [club-3090](https://github.com/noonghunna/club-3090) project (we vendor Strata in our catalog; [open PR #1888](https://github.com/noonghunna/club-3090/pull/1888) forwards `STRATA_PLE_AUTO_RAM` as a launch workaround on all five Strata composes and documents the two RAM paths). Happy to run any instrumented build on this rig. ### Logs **clean-repro-boot.log — the primary watchdogged capture (2026-10-31 18:07:45 UTC, container stopped at the arena wait):** ``` [strata] 2026-10-31 18:07:45 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --layer-split auto --batch 3 strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 4.5 GiB, reclaimable cache credited 0.0 GiB; available 87.4 GiB (MemAvailable 87.4 GiB), floor 2560 MiB strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto) strata generate: PCIe probe: 24.8 GB/s host->device (best of 24.8 24.8 24.8 24.8) -> pcie_frac 0.55 (default 0.55) strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows) strata generate: rope scaling yarn, factor 2 (freq_scale 0.5, base 1e+07, mscale 1.069315), --max-context 524288 against a trained context of 262144 strata generate: note: the YaRN magnitude correction scales cos and sin by 1.069315 at every position strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s) strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.7 s (302 canonical tensors skipped: served natively) strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.8 s strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.7 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them) strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 11.3 s strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.7 6.7 6.7) -> pcie_frac 0.18 strata generate: layer split: CUDA1 holds its weights; 19.59 GiB free (its session follows the split search) strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.84 GiB free before its session carve strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00 strata generate: layer split auto: CUDA1 link 6.7 GB/s -> miss cost x1.00 strata generate: layer split auto: K=20 - predicted 24.5 ms per decode window; the caches hold 18742 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements strata generate: layer split auto: NEAR TIE - K=23 is predicted 24.6 ms per decode window, within 0.5% of K=20 (24.5 ms); the cards differ, so the prediction may not rank them (it prices decode, not the prompt). To try the other: --layer-split 23 strata generate: KV streaming: 32768 of 524288 cells per QSA layer in VRAM, the K/V in 2.58 GiB of pinned RAM strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 18.23 GiB free strata generate: --batch-groups auto: 1 group of 3 slots strata generate: --batch: 3 slot sessions on CUDA0 (0.66 GiB each); 16.97 GiB free strata generate: --batch: 3 slot sessions on CUDA1 (0.87 GiB each); 15.59 GiB free strata generate: --batch 3: the slot sessions take 1.97 GiB of VRAM on CUDA0 that the expert cache would otherwise hold strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.58 s (1360 MiB/s) strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6 strata generate: the expert arena needs 46.84 GiB of RAM and 33.66 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 33.63 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this) ``` **registration-after-timeout-144344.log — an unwatchdogged 1M boot: the wait expires and the registration line follows immediately:** ``` [strata] 2026-10-31 14:43:44 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 1048576 --kv int8 --kv-resident 32768 --rope-scaling yarn --rope-scale 4 --layer-split auto --batch 3 strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 4.2 GiB, reclaimable cache credited 0.0 GiB; available 87.6 GiB (MemAvailable 87.6 GiB), floor 2560 MiB strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto) strata generate: PCIe probe: 24.9 GB/s host->device (best of 24.7 24.9 24.7 24.8) -> pcie_frac 0.55 (default 0.55) strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows) strata generate: rope scaling yarn, factor 4 (freq_scale 0.25, base 1e+07, mscale 1.138629), --max-context 1048576 against a trained context of 262144 strata generate: note: the YaRN magnitude correction scales cos and sin by 1.138629 at every position strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s) strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.6 s (302 canonical tensors skipped: served natively) strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.8 s strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 87.0 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them) strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 13.0 s strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.7 6.7 6.7) -> pcie_frac 0.18 strata generate: layer split: CUDA1 holds its weights; 19.61 GiB free (its session follows the split search) strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.86 GiB free before its session carve strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00 strata generate: layer split auto: CUDA1 link 6.6 GB/s -> miss cost x1.00 strata generate: layer split auto: K=20 - predicted 24.6 ms per decode window; the caches hold 18219 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements strata generate: KV streaming: 32768 of 1048576 cells per QSA layer in VRAM, the K/V in 5.16 GiB of pinned RAM strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 17.66 GiB free strata generate: --batch-groups auto: 1 group of 3 slots strata generate: --batch: 3 slot sessions on CUDA0 (1.10 GiB each); 15.17 GiB free strata generate: --batch: 3 slot sessions on CUDA1 (1.43 GiB each); 13.28 GiB free strata generate: --batch 3: the slot sessions take 3.30 GiB of VRAM on CUDA0 that the expert cache would otherwise hold strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.68 s (1149 MiB/s) strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6 strata generate: the expert arena needs 46.84 GiB of RAM and 8.56 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 8.62 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 8.65 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 10 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 8.70 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 15 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 1 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (STRATA_ARENA_THP=1 requests them anyway) (#2126) ``` **incident-boot-145520.log — the 524288 boot quoted in step 3, ending mid-wait at '- 15 s so far'; the host died minutes later:** ``` [strata] 2026-10-31 14:55:20 engine started: /opt/strata/components/engine/0.1.55-linux-x86_64-cuda-cuda13/strata --serve --pack /data/Strata-data/packs/iq3_s --native /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --ple-gguf /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf --expert-profile /opt/strata/terminal/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /data/Strata-data/mtp/rt --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --layer-split auto --batch 3 strata: sm_86 (Ampere): 9 exact speed switches on by default (STRATA_SM86_PERF=0 turns them off; a switch you set is kept): ADAPT_NOWAIT ADAPT_LAG CPU_IQ_ALL_EXACT1 SIDE_MIXER ATTN_DAILY GR_UP75 GU_SWIGLU QSA_ROWS B6_MMVQ_ROWS strata generate: memory guard: limit 91.9 GiB (source: meminfo), current 3.9 GiB, reclaimable cache credited 0.0 GiB; available 88.0 GiB (MemAvailable 88.0 GiB), floor 2560 MiB strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto) strata generate: PCIe probe: 24.8 GB/s host->device (best of 24.8 24.8 24.8 24.8) -> pcie_frac 0.55 (default 0.55) strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows) strata generate: rope scaling yarn, factor 2 (freq_scale 0.5, base 1e+07, mscale 1.069315), --max-context 524288 against a trained context of 262144 strata generate: note: the YaRN magnitude correction scales cos and sin by 1.069315 at every position strata generate: native pack: /data/Strata-data/packs/iq3_s experts (largest blob 2.66 MB), token embedding IQ4_XS in mapped host memory (322 MiB, 0.1 s) strata generate: 1466 MiB of weights loaded from /data/Strata-data/packs/iq3_s in 0.3 s (302 canonical tensors skipped: served natively) strata generate: 300 native projection matrices, 2018.88 MiB of weights, in 0.3 s strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 87.4 GiB of RAM is available; STRATA_PLE_AUTO_RAM=0 keeps the direct reads, --ple-io direct forces them) strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 0.5 s strata generate: layer split: CUDA1 PCIe probe 6.7 GB/s (best of 6.7 6.6 6.7 6.7) -> pcie_frac 0.18 strata generate: layer split: CUDA1 holds its weights; 19.59 GiB free (its session follows the split search) strata generate: profile /opt/strata/terminal/data/expert-profile.bin: 24576 ranked pairs, built for 24576 slots strata generate: layer split auto: CUDA0 82 SMs at 1.70 GHz -> 0.52 ms per layer, 18.94 GiB free before its session carve strata generate: layer split auto: CUDA1 84 SMs at 1.95 GHz -> 0.44 ms per layer, 17.84 GiB free before its session carve strata generate: layer split auto: CUDA0 link 24.8 GB/s -> miss cost x1.00 strata generate: layer split auto: CUDA1 link 6.7 GB/s -> miss cost x1.00 strata generate: layer split auto: K=20 - predicted 24.5 ms per decode window; the caches hold 18741 of 24576 profiled pairs (~99.1% of the routed mass), best of 46 placements strata generate: layer split auto: NEAR TIE - K=23 is predicted 24.6 ms per decode window, within 0.5% of K=20 (24.5 ms); the cards differ, so the prediction may not rank them (it prices decode, not the prompt). To try the other: --layer-split 23 strata generate: KV streaming: 32768 of 524288 cells per QSA layer in VRAM, the K/V in 2.58 GiB of pinned RAM strata generate: PLE on, table 320001536 rows of /gguf/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf strata generate: layer split: CUDA1 holds its weights, session [20, 48) and the head; 18.23 GiB free strata generate: --batch-groups auto: 1 group of 3 slots strata generate: --batch: 3 slot sessions on CUDA0 (0.66 GiB each); 16.97 GiB free strata generate: --batch: 3 slot sessions on CUDA1 (0.87 GiB each); 15.59 GiB free strata generate: --batch 3: the slot sessions take 1.97 GiB of VRAM on CUDA0 that the expert cache would otherwise hold strata mtp: draft layer loaded, 836 MiB of VRAM (experts 675, dense 111), files read in 0.37 s (2099 MiB/s) strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6 strata generate: the expert arena needs 46.84 GiB of RAM and 34.60 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 34.67 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 5 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 34.70 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 10 s so far (STRATA_ARENA_RAM_WAIT_S changes this) strata generate: the expert arena needs 46.84 GiB of RAM and 34.78 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 15 s so far (STRATA_ARENA_RAM_WAIT_S changes this) ``` **journal-deaths.txt — host journal: last lines of the four dead boots, boot 0's first line, meminfo (Cma/Swap):** ``` Oct 31 10:29:08 aipc systemd[1]: systemd-timedated.service: Deactivated successfully. Oct 31 10:30:11 aipc rtkit-daemon[3142]: The canary thread is apparently starving. Taking action. Oct 31 10:38:29 aipc rtkit-daemon[2844]: Demoted 1 threads. Oct 31 10:38:50 aipc systemd-journald[609]: Under memory pressure, flushing caches. Oct 31 10:45:48 aipc systemd-journald[633]: Under memory pressure, flushing caches. Oct 31 10:45:48 aipc systemd-resolved[671]: Under memory pressure, flushing caches. Oct 31 10:56:48 aipc systemd-journald[637]: Under memory pressure, flushing caches. Oct 31 10:56:22 aipc systemd-resolved[676]: Under memory pressure, flushing caches. --- boot0 first: Oct 31 07:00:02 aipc kernel: Linux version 7.0.0-38-generic (buildd@lcy02-amd64-070) (x86_64-linux-gnu-gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.46) #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 4 09:10:14 UTC 2026 (Ubuntu 7.0.0-38.38-generic 7.0.14) --- meminfo: SwapTotal: 8388604 kB CmaTotal: 0 kB CmaFree: 0 kB ``` **How the clean capture was taken safely:** a watchdog tails the engine log, and at the first `expert arena needs ... is available` line runs `switch.sh --down` — inside the 20 s wait, before the arena registration. The script is in our repo scratch; happy to share it.
Author
Owner

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

  • Fill in "Area".
  • Fill in "Desktop app, Terminal or source?".

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:6547358904 --> @github-actions[bot] commented on GitHub (Oct 31, 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: - [ ] Fill in "Area". - [ ] Fill in "Desktop app, Terminal or source?". 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 31, 2026):

Thanks, this follows the format now.

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

@eddietheengineer commented on GitHub (Oct 31, 2026):

Update: the same stall happens with the table NOT locked — the engine should fail gracefully when the arena does not fit

A second capture from this rig, 2026-10-31 18:32:14 UTC: --max-context 1048576 --rope-scaling yarn --rope-scale 4 with STRATA_PLE_AUTO_RAM=0 — the workaround from the body. The residency policy never ran, the table was never locked:

strata generate: PLE direct read probe: 44878 rows/s (fine)
strata generate: KV streaming: 32768 of 1048576 cells per QSA layer in VRAM, the K/V in 5.16 GiB of pinned RAM
strata generate: the expert arena needs 46.84 GiB of RAM and 34.98 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this)
... (5 s: 34.99, 10 s: 35.01, 15 s: 35.04)
strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 20 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (STRATA_ARENA_THP=1 requests them anyway) (#2126)

Then the registration went ahead — and the host stalled the same way: the journal's last entries are Under memory pressure, flushing caches at 18:33:59 UTC (14:33:59 local), no shutdown sequence; the box needed a power reset (next boot 18:36).

This is on purpose, not a watchdog miss: the =0 config is our serving config, and the 1M boot was an attempt to raise the context further. The =0 boots at 524288 come up with ~6.7 GiB MemAvailable to spare; at 1048576 the KV stream's pinned RAM grows (2.58 → 5.16 GiB) and the arena no longer fits even with the table on disk.

Why this matters for the fix above: the give-back at the arena-wait point would not have saved this boot — there was no lock to give back. The general defect is that ArenaExpertSource::open() measures available < need (46.84 vs 34.98), waits, and calls cudaHostRegister regardless. The wait's own comment says the load "goes on either way - it only warns", and the warning text itself predicts "the whole machine can stall in memory reclaim until it is restarted (#4051)" — but a warning that requires a power reset to act on is not a warning.

Suggested addition to the ask: when the shortfall survives the wait, do not register. Options in rough order of preference: (a) refuse the start with the same error text the warning already computes ("the arena needs X, Y is available — close other programs, or run with --mmap-experts --resident-budget-gib N") — the engine has every number at that point; (b) auto-fall back to --mmap-experts with a resident budget sized from what is actually available, and say so; (c) at minimum, cap the wait's follow-through so the registration is skipped when available < need still holds after it. All three turn a host power-reset into a startup error, which is the difference between a bug report and a support ticket.

The PLE give-back (the body's ask) is still the right fix for the 524288 case — on a 92 GiB rig the two together are what make raised contexts safe: give the lock back when the arena needs the room, and refuse the start when even then the arena does not fit.

<!-- gh-comment-id:6547593803 --> @eddietheengineer commented on GitHub (Oct 31, 2026): ## Update: the same stall happens with the table NOT locked — the engine should fail gracefully when the arena does not fit A second capture from this rig, 2026-10-31 18:32:14 UTC: `--max-context 1048576 --rope-scaling yarn --rope-scale 4` **with `STRATA_PLE_AUTO_RAM=0`** — the workaround from the body. The residency policy never ran, the table was never locked: ``` strata generate: PLE direct read probe: 44878 rows/s (fine) strata generate: KV streaming: 32768 of 1048576 cells per QSA layer in VRAM, the K/V in 5.16 GiB of pinned RAM strata generate: the expert arena needs 46.84 GiB of RAM and 34.98 GiB is available; waiting up to 20 s for it (another engine still exiting?) - 0 s so far (STRATA_ARENA_RAM_WAIT_S changes this) ... (5 s: 34.99, 10 s: 35.01, 15 s: 35.04) strata: expert arena: MAP_HUGETLB unavailable (needed 23983 2 MiB pages, vm.nr_hugepages=0); transparent huge pages NOT requested: only 20 GiB of free 2 MiB blocks for a 46 GiB arena, compaction would stall the load (STRATA_ARENA_THP=1 requests them anyway) (#2126) ``` Then the registration went ahead — and the host stalled the same way: the journal's last entries are `Under memory pressure, flushing caches` at 18:33:59 UTC (14:33:59 local), no shutdown sequence; the box needed a power reset (next boot 18:36). This is on purpose, not a watchdog miss: the `=0` config is our serving config, and the 1M boot was an attempt to raise the context further. The `=0` boots at 524288 come up with ~6.7 GiB MemAvailable to spare; at 1048576 the KV stream's pinned RAM grows (2.58 → 5.16 GiB) and the arena no longer fits even with the table on disk. **Why this matters for the fix above:** the give-back at the arena-wait point would not have saved this boot — there was no lock to give back. The general defect is that `ArenaExpertSource::open()` measures `available < need` (46.84 vs 34.98), waits, and calls `cudaHostRegister` regardless. The wait's own comment says the load "goes on either way - it only warns", and the warning text itself predicts "the whole machine can stall in memory reclaim until it is restarted (#4051)" — but a warning that requires a power reset to act on is not a warning. **Suggested addition to the ask:** when the shortfall survives the wait, do not register. Options in rough order of preference: (a) refuse the start with the same error text the warning already computes ("the arena needs X, Y is available — close other programs, or run with `--mmap-experts --resident-budget-gib N`") — the engine has every number at that point; (b) auto-fall back to `--mmap-experts` with a resident budget sized from what is actually available, and say so; (c) at minimum, cap the wait's follow-through so the registration is skipped when `available < need` still holds after it. All three turn a host power-reset into a startup error, which is the difference between a bug report and a support ticket. The PLE give-back (the body's ask) is still the right fix for the 524288 case — on a 92 GiB rig the two together are what make raised contexts safe: give the lock back when the arena needs the room, and refuse the start when even then the arena does not fit.
Author
Owner

@eddietheengineer commented on GitHub (Nov 7, 2026):

Reporter update — re-tested on 0.2.11 (engine 0.1.57): both boots from this issue now serve, and the give-back fix was observed firing under forced pressure.

Rig: 2× RTX 3090 / 3090 Ti, 91.9 GiB RAM, SSD model disk — so the residency policy is the live mechanism here (on a rotational disk, setup writes --ple-io ram directly and the policy never runs).

Boot 1 — the hang repro from the issue body: --max-context 524288 --rope-scaling yarn --rope-scale 2, default PLE policy. On 0.2.11 it comes up and serves. The policy still locks the table, but on a clean boot the arena fits after the lock, so the wait never arms:

strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.6 GiB of RAM is available; ...)
strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 0.6 s
strata generate: loaded 46.84 GiB at 2.73 GiB/s
strata generate: session is up (engine 0.1.57)

Ready in 72 s, MemAvailable at ready ≈ 30 GiB, host never stalled.

Boot 2 — --max-context 1048576 --rope-scaling yarn --rope-scale 4 with STRATA_PLE_AUTO_RAM=0. Serves: PLE stays on direct disk reads (PLE direct read probe: 107896 rows/s (fine), no lock line), arena registers, MemAvailable at ready ≈ 20.8 GiB. A full context stress against this boot passes 8/8 (needle recall clean to 813K tokens, prefill 2,184 → 1,648 t/s from 95K → 903K, VRAM flat, swap ~zero).

Forcing the pressure so the fix actually runs. A static RAM pin can't arm the arena wait: the policy's lock test (table 26.8 + arena 46.8 ≤ available) and the arena's fit test (available − 26.8 ≥ 46.8) are the same 73.6 GiB boundary — whenever the policy locks, the arena fits. The original hang crossed it because a dying previous engine still held ~21 GiB of mlocked RAM between the two checks (the wait message's own "another engine still exiting?" hint). So I pinned 11 GiB with MAP_LOCKED and re-ran boot 1: the arena still fit, but the boot starved under the lock at the next allocation — and the give-back fired:

strata serve: PLE table lock given back: the lock left 4.8 GiB of RAM for the conversation cache,
  31.1 GiB without it (the table stays cached; --conversation-cache-mib N and --ple-io ram are kept as asked)

The boot completed and served (session is up, verify windows captured, KV streaming 96.3 % VRAM hit); MemAvailable bottomed at 5.5 GiB mid-boot and settled at 30.5 GiB. On 0.1.55 this exact shape — lock held, downstream allocation starved — was the host stall.

Not exercised in isolation: the arena-wait branch specifically (the the expert arena needs … waiting up to 20 s lines from the original captures). Per the boundary arithmetic above it needs overlapping boots rather than a static pin — a second Strata boot started while the first is still draining its mlocked table/arena. If you want that capture too, I can attempt it; the host-stall guard (stop below 2 GiB MemAvailable) is scripted.

As we read it, 0.2.10's give-back covers both failure shapes in this issue, and the fix is working as described. Happy to provide further logs — and this is also cross-posted on our side (noonghunna/club-3090#1888), so the issue can be closed against 0.2.11 if you're satisfied.

<!-- gh-comment-id:6709622734 --> @eddietheengineer commented on GitHub (Nov 7, 2026): Reporter update — re-tested on 0.2.11 (engine 0.1.57): both boots from this issue now serve, and the give-back fix was observed firing under forced pressure. Rig: 2× RTX 3090 / 3090 Ti, 91.9 GiB RAM, **SSD model disk** — so the residency policy is the live mechanism here (on a rotational disk, setup writes `--ple-io ram` directly and the policy never runs). **Boot 1 — the hang repro from the issue body: `--max-context 524288 --rope-scaling yarn --rope-scale 2`, default PLE policy.** On 0.2.11 it comes up and serves. The policy still locks the table, but on a clean boot the arena fits after the lock, so the wait never arms: ``` strata generate: --ple-io ram chosen by the residency policy (the table is 26.8 GiB, the expert arena still to fill 46.8 GiB and 86.6 GiB of RAM is available; ...) strata generate: PLE table locked in RAM (--ple-io ram chosen by the residency policy) in 0.6 s strata generate: loaded 46.84 GiB at 2.73 GiB/s strata generate: session is up (engine 0.1.57) ``` Ready in 72 s, MemAvailable at ready ≈ 30 GiB, host never stalled. **Boot 2 — `--max-context 1048576 --rope-scaling yarn --rope-scale 4` with `STRATA_PLE_AUTO_RAM=0`.** Serves: PLE stays on direct disk reads (`PLE direct read probe: 107896 rows/s (fine)`, no lock line), arena registers, MemAvailable at ready ≈ 20.8 GiB. A full context stress against this boot passes 8/8 (needle recall clean to 813K tokens, prefill 2,184 → 1,648 t/s from 95K → 903K, VRAM flat, swap ~zero). **Forcing the pressure so the fix actually runs.** A static RAM pin can't arm the arena wait: the policy's lock test (`table 26.8 + arena 46.8 ≤ available`) and the arena's fit test (`available − 26.8 ≥ 46.8`) are the same 73.6 GiB boundary — whenever the policy locks, the arena fits. The original hang crossed it because a *dying previous engine* still held ~21 GiB of mlocked RAM between the two checks (the wait message's own "another engine still exiting?" hint). So I pinned 11 GiB with `MAP_LOCKED` and re-ran boot 1: the arena still fit, but the boot starved *under the lock* at the next allocation — and the give-back fired: ``` strata serve: PLE table lock given back: the lock left 4.8 GiB of RAM for the conversation cache, 31.1 GiB without it (the table stays cached; --conversation-cache-mib N and --ple-io ram are kept as asked) ``` The boot completed and served (`session is up`, verify windows captured, KV streaming 96.3 % VRAM hit); MemAvailable bottomed at 5.5 GiB mid-boot and settled at 30.5 GiB. On 0.1.55 this exact shape — lock held, downstream allocation starved — was the host stall. **Not exercised in isolation:** the arena-wait branch specifically (the `the expert arena needs … waiting up to 20 s` lines from the original captures). Per the boundary arithmetic above it needs overlapping boots rather than a static pin — a second Strata boot started while the first is still draining its mlocked table/arena. If you want that capture too, I can attempt it; the host-stall guard (stop below 2 GiB MemAvailable) is scripted. As we read it, 0.2.10's give-back covers both failure shapes in this issue, and the fix is working as described. Happy to provide further logs — and this is also cross-posted on our side (noonghunna/club-3090#1888), so the issue can be closed against 0.2.11 if you're satisfied.
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#2226
No description provided.