Three commits on 662e72ac2. With STRATA_HIP_PROMPT_F16=1 the fused hyper-connection up-mix (STRATA_HC_UPMIX, on by default on the 780M under Linux and in the Windows Strix Halo set) read the
FP16 activation images as BF16: forced-token KL 166 times that of the MMQ path, top-1 68.7%. The up-mix kernel now has an FP16 variant (new test hip_gr_upmix_parity: 20 BF16 and 6 FP16-io
sizes up to 8,192 tokens, error against FP64 1.6e-7 to 3.6e-7 of the largest value for the fused kernel, 6.2e-5 to 1.2e-4 for the FP16 pair), and a Radeon 780M (gfx1103, integrated, Linux)
now runs the prompt's 16-bit GEMMs FP16 in and out with nothing set. STRATA_HIP_PROMPT_F16=0 is the way back; =1 still works on any card. Every other chip, every discrete card and
Windows are unchanged, and nothing is printed for the default.
Measured on a Radeon 780M (Q2_0, 24 prompts of 2K tokens, 64 forced tokens each, the draft-cost table fixed): forced-token KL against the FP16 path, ratio to the MMQ path 1.091 [0.968, 1.231]
with FP16 io, top-1 97.5%; prompt speed ratio to nothing set 1.11 / 1.15 / 1.19 / 1.25 at 300 / 1,000 / 2,048 / 8,192 tokens (with the fused prompt kernels on top: 1.11 / 1.15 / 1.63 / 1.45).
The branch changes include/strata/core/arch_defaults.hpp and src/core/arch_defaults_test.cpp, which the earlier fused-default merge also changed at the same place; both sides are kept (the
fused-default declaration and test block first, the FP16-io ones after). The settings register is regenerated by its tool on the merged tree, with the hand-kept status (default) and note
of STRATA_HIP_PROMPT_F16 from the branch.
Five commits on 662e72ac2. Flash-Next's K-quant packs (UD-Q4_K_XL: Q4_K / Q5_K gate/up with a Q5_1 or Q8_0 down) took llama.cpp's MMQ kernels for the
prompt by default. Now, on compute capability 8.0 / 8.6 / 8.9 and 12.0 cards with 80 or more multiprocessors (RTX A6000, A40, RTX 3090, A100, RTX 40 and
RTX PRO 5000 class), and on the 40 to 79 multiprocessor cards (RTX A4000, RTX 5070 class) for the staged launches, the fused kernels read them;
STRATA_PF_FUSED_KQ=0 gives MMQ back (STRATA_PF_FUSED_SM40=0 for the 40 to 79 class only, STRATA_PF_FUSED=0 for every fused kernel). The tile: sm_86-class
cards with 80 to 99 multiprocessors take the 128-row tile for these pairs from 5.8 rows an expert, sm_120 cards with 100 to 149 multiprocessors the same for
the two Q8_0-down pairs; every other card keeps its tile pick. Under 40 multiprocessors, compute capability below 8, HIP and the other formats: as before.
The start-up line about K-quant experts says what runs on the card (src/core/nv_defaults.cpp, nv_kq_fused_here), and the QUANTS.md row names the fused kernels.
Measured on an RTX A6000 (UD-Q4_K_XL, 55% of the experts on the card): the 48 forced continuations score byte for byte the same as the old tile with the fused
kernels on (scored-file hash 362035373b02d395...), and with the way back set the same as MMQ (0f58ac95a92d51a6...); prompt speed against the way back
0.99 / 0.96 / 0.98 / 0.99 / 1.01 / 0.99 at 300 / 1,000 / 2,049 / 4,097 / 8,193 / 20,001 tokens; decode unchanged.
The branch changed data/settings-register.json (the status and the note of STRATA_PF_FUSED_KQ); so did the head (generated fields). The register conflicted
in one hunk: the STRATA_PF_FUSED_KQ entry's git stamps (head: 3a61182bbf, the branch: 4dbaf703fd) and its status (head: opt-in, the branch: rollback). The status
of the branch is kept (a hand-kept field); the file was then regenerated with tools/settings_register.py on the merged tree, so every generated field is the
tool's output for this tree (the new reads in nv_defaults.cpp and moe_fused_iq.cu, and the line numbers that moved). The hand-kept fields of both sides
are carried unchanged (checked field by field against each side's change). docs/SETTINGS.md is regenerated after the gate round, not here.
On a Radeon 780M (gfx1103, integrated) under Linux the engine now runs the prompt's 16-bit GEMMs FP16 in and out when the user
has not set STRATA_HIP_PROMPT_F16: "1" still turns it on on any card, any other set value (0) is the way back, and every other
architecture, every discrete card and Windows stay opt-in as before. The rule is prompt_f16_resolve
(include/strata/core/arch_defaults.hpp), used by prompt_f16() in src/prefill/gemm.cu; it needs integrated, not Windows and a
gcnArchName of exactly gfx1103 (the :sramecc / :xnack suffix forms included). Nothing is printed at start for the default; the
"FP16 in and out" line still appears when the variable is set to 1 and the gfx103x tip is unchanged. Not flipped elsewhere: a
Radeon AI PRO R9700 (gfx1201) is slower with it on (dense GEMMs x0.70 to x0.72), gfx103x has no run of ours on real activations,
the other gfx11 chips have no number.
It needs the two commits before it on this branch: with the FP16 prompt path the fused hyper-connection up-mix (on by default on
this card) read FP16 activations as BF16, which made the first measurement of this default wrong (forced-token KL 166 times the
MMQ path's); that is fixed and the up-mix now has an FP16 variant.
Measured on a Radeon 780M (Q2_0 pack, 3 interleaved rounds, prompt tok/s medians, nothing set -> FP16 io): 300 tokens 124.3 ->
138.5 (x1.114), 1,000 157.7 -> 181.7 (x1.152), 2,048 208.7 -> 248.9 (x1.193), 8,192 270.0 -> 337.8 (x1.251). Beside
STRATA_PF_FUSED=1: x1.111 / x1.152 / x1.628 / x1.450 against nothing set.
Quality, same card: forced-token KL against the FP16 path (24 prompts of 2,048 tokens, 64 forced tokens each, draft-cost table
fixed, repeat arms equal their first run byte for byte): 0.00593 against 0.00543 for MMQ (ratio 1.091, 95% CI 0.968 to 1.231),
top-1 agreement with the FP16 path 97.46% against 97.27%, no non-finite value. Not run: any other card; no second model.
This commit also updates the settings register entry of STRATA_HIP_PROMPT_F16 and the rows of docs/AMD_HIP.md and
docs/RADEON_780M.md.
With --batch 2 or more on Windows, HIP, integrated AMD (the gfx1151 block that sets the own-path prompt chunk) and a RAM budget in the start
arguments, every session (the main one and each slot) pins its streamed K/V for the whole context, and the RAM copy of experts is pinned on top of
that; at 4 slots and 131,072 tokens the engine stopped inside the prompt path's allocation, and with a smaller budget the OS ran out of page-locked
memory. The RAM copy is now cut to what keeps it plus the sessions' pinned K/V at 22.75 GiB (include/strata/core/uma_cache.hpp, two plain inline
functions, unit tested in src/core/uma_cache_test.cpp), the level of the largest 4-slot start that worked (15 GiB of experts, 7.75 GiB of K/V).
The experts left out are read from the SSD when needed. Context, slot count and the 16,384-token chunk are untouched; --batch 1, starts without
--batch, every other OS and backend, and 2 and 3 slots on a 64 GB box (their RAM copy is under the cap) are unchanged.
The cap has no floor: for any number of requests the engine keeps as little in RAM as needed and starts. With so many slots that their pinned K/V
alone is over 22.75 GiB the RAM copy is empty (budget 1 byte; 0 would mean no limit) and every expert outside the GPU cache is read from the SSD;
the start goes on.
The engine says so once after the pin, only when the cap cut: "N requests at once: X GiB of experts are kept in RAM so that everything fits in
this PC's memory; the rest are read from the SSD when needed (STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set)", or at cap 0 the same without
the figure. After a start that really failed with 2 or more slots the engine says "N requests at once do not fit in this PC's memory: start with
--batch N-1", and the Terminal's step for that failure reads "This PC's memory cannot hold that many requests at once. Lower Concurrent requests
in the app (or `--parallel` in the Terminal) by one and start again." (strata_cli/launch/runner.py, tests/terminal/test_batch_memory_words.py).
STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set (settings register status rollback; one sentence in docs/BATCHING.md).
Measured on a Strix Halo with 64 GB (UD-Q4_K_XL, 131,072 context, 4 prompts of 68 to 2,067 tokens): 2 slots and 3 slots print no line and keep their
cache slots; 4 slots print the line with 15.0 GiB, start and serve every slot; the one-slot run gives the same 36 ids as before.
Both branches changed data/settings-register.json and src/program/generate.cpp. generate.cpp merged without a conflict. The register conflicted in
three hunks, all generated fields (the line numbers of the STRATA_PF_FUSED reads and defaults, and one read entry); it was resolved by running
tools/settings_register.py on the merged tree, so every generated field is the tool's output for this tree, and the hand-kept fields (status, owner,
note) of both branches are carried unchanged (checked against git's own merge of the file: no hand-kept field differs). docs/SETTINGS.md is
regenerated after the gate round, not here.
This puts the 40-79 SM cards back into kq_takes for an unset switch, as the default commit had them: takes_by_default with its staged-launch clause (the K-quant
gate/up is a weight-staging instance and its Q5_1 / Q8_0 down is one the staged kernels were measured with). The commit before this one took the class out because
its one-layer table is below MMQ at 20,000 tokens; the rule for a default here is that our own kernels take over where quality is kept, also when they are a little
slower at the largest size. The evidence for the class:
- One layer of Flash-Next's shape on an RTX A4000 (sm_86, 48 SMs, CUDA 12.9, 128-row tile, one repetition), MMQ time / fused time at 300 / 1,000 / 2,048 / 4,096 /
8,192 / 20,000 tokens: 1.67 / 1.44 / 1.49 / 1.35 / 1.05 / 0.97 (Q4_K / Q5_1), 1.79 / 1.61 / 1.67 / 1.46 / 1.08 / 0.98 (Q4_K / Q8_0), 1.72 / 1.59 / 1.60 / 1.45 / 1.05 /
0.99 (Q5_K / Q8_0): ahead up to 8,192 tokens, 1 to 3% behind at 20,000.
- The staged K-quant fused path runs end to end on that A4000 in the Qwen3.6 engine.
- No end-to-end run of Flash-Next on a card of that size; the Qwen3.6 engine runs the same staged path there.
The commit undoes the one before it (kq_takes takes its SM40 argument again, the grid test, the start-up-line test, the register note and the docs/QUANTS.md row name the
RTX A4000 and RTX 5070 class again) and adds the numbers above to the comment of kq_takes. Host code only.
The cap on the pinned RAM copy of experts (--batch 2 or more, Windows HIP, integrated GPU) printed
its line at 2 and 3 slots too, where the whole copy (12.47 and 16.40 GiB) is under the cap and
nothing is cut: "18.1 GiB of experts are kept in RAM" was wrong there. Now the line comes after
the pin and only when the RAM copy reached the cap (4 slots at 131,072 tokens: 15.0 GiB).
STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set (any other value, or unset, leaves the cap on);
the line names it: "(STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set)". The register entry is
now status rollback with the measured points in its note, and docs/BATCHING.md has one sentence
where the memory per slot is described.
With --batch 4 at 131,072 tokens on a Strix Halo (UD-Q4_K_XL, the usual 38 GiB RAM
budget) the engine stopped inside the prompt path's allocation, and with an 18 GiB
budget the OS ran out of page-locked memory. Every session (the main one and each
slot) pins its streamed K/V for the whole context, 1.55 GiB at 131,072 tokens, and the
RAM copy of experts is pinned on top of that.
Now, with --batch 2 or more on this path, the RAM copy is cut to what leaves the RAM
copy plus the sessions' pinned K/V at 22.75 GiB, the level of the largest 4-slot start
that worked (15 GiB of experts, 7.75 GiB of K/V). The experts left out are read from
the SSD when needed. Context, slot count and the 16,384-token prompt chunk are
untouched; --batch 1 does not enter the code. The engine says so in one line, and
after a real init failure with 2 or more slots it names --batch N-1.
Measured on the box (4 slots, 131,072 tokens, 15 GiB): starts and serves, 49.2
tok/s inside the batch windows against 56.4 with the whole copy at a 65,536 context;
the 2,067-token prompt reads at 837 against 1,054 tok/s. 3 slots and below are not
changed: their RAM copy plus K/V is at or under the level.
The constant and its measured starts are in include/strata/core/uma_cache.hpp.
STRATA_UMA_PIN_CAP (test only, register status research) turns the cap off.
The previous commit let the 40-79 SM cards take the K-quant fused kernels with nothing set (through takes_by_default's staged-launch clause). The only
measurement on such a card is one layer of Flash-Next's shape on an RTX A4000 (sm_86, 48 SMs, CUDA 12.9, one repetition, 128-row tile, which is what the
rule picks there): MMQ time / fused time 1.67 / 1.44 / 1.49 / 1.35 / 1.05 / 0.97 (Q4_K / Q5_1), 1.79 / 1.61 / 1.67 / 1.46 / 1.08 / 0.98 (Q4_K / Q8_0) and
1.72 / 1.59 / 1.60 / 1.45 / 1.05 / 0.99 (Q5_K / Q8_0) at 300 / 1,000 / 2,048 / 4,096 / 8,192 / 20,000 tokens: below MMQ at 20,000 tokens, and no end-to-end
run exists on a card of that size. A default goes only where it was measured, so kq_takes now answers "80 or more SMs on an sm_86-class or sm_120 card" for an
unset switch and drops its SM40 argument; STRATA_PF_FUSED_KQ=1 still sets the kernels up on every sm_80+ card and =0 still turns them off.
Host code, a comment, the rule's grid test (now 4,824 combinations of the switch, the card flags and 0-200 SMs against its oracle, none yes below 80 SMs), the
start-up-line test, the register note and the docs/QUANTS.md row, which no longer names the RTX A4000 or RTX 5070 class.
The line apply_nv_kq_default prints at every NVIDIA start of compute capability 8.0 and up said that a model with K-quant experts reads its
prompt on llama.cpp's MMQ kernels. With the previous commit that is no longer true on the cards the fused K-quant default takes. The call
now gets one more argument: whether Strata's own kernels read the K-quant experts on a visible card, from the new nv_kq_fused_here(major,
minor, SM count), which is fused_tile::kq_takes with the switches the engine reads (STRATA_PF_FUSED=0, STRATA_PF_FUSED_KQ, STRATA_PF_FUSED_SM40,
STRATA_PF_FUSED_SM86). Where it is true the line reads
strata: a model with K-quant experts (Unsloth UD-Q4/Q5/Q6_K_XL) reads its prompt on Strata's own kernels where they cover the layer (Q4_K and
Q5_K gate/up with a Q5_1 or Q8_0 down) and on llama.cpp's MMQ kernels for the rest (STRATA_PF_FUSED_KQ=0 gives all of them back to MMQ)
and where it is false the earlier line, byte for byte. generate.cpp asks every visible card and says it if any of them takes the kernels.
The line is printed as before: only when STRATA_MMQ_KQ was set by this default. src/core/nv_defaults_test.cpp checks both texts and the
card answer for the named cards, the way-back switches and the opt-in.
docs/QUANTS.md, row "Q4_K (gate/up)", column "CUDA prompt" (the Q5_K and Q5_1 rows say "as Q4_K"): names the fused kernels and the way back.
docs/SETTINGS.md is generated from the register and is not regenerated here.
Evidence for the 40 to 79 SM clause (RTX A4000, sm_86, 48 SMs, one layer of Flash-Next's shape, the staged 128-row tile the rule picks, MMQ ms /
fused ms at 300 / 1,000 / 2,048 / 4,096 / 8,192 / 20,000 tokens): Q4_K / Q5_1 1.67 1.44 1.49 1.35 1.05 0.97, Q4_K / Q8_0 1.79 1.61 1.67 1.46
1.08 0.98, Q5_K / Q8_0 1.72 1.59 1.60 1.45 1.05 0.99; the 64-row tile is slower at every size (0.60 to 1.37); the output bits hash is equal at
every tile. No end-to-end row exists on a card of 40 to 79 SMs with a K-quant set.
Work in progress, not gated. The rule: an integrated gfx1103 / gfx1150 / gfx1151 GPU under Linux (the class of the arena
and settle defaults) sets STRATA_PF_FUSED=1 at start when the user has not set the variable; STRATA_PF_FUSED=0 is the way
back to MMQ. Nothing else changes: no new log line (the prefill's own line about the fused kernels appears once they are taken).
Measured on a Radeon 780M (Q2_0 pack, 3 interleaved rounds, prompt tok/s medians, nothing set -> STRATA_PF_FUSED=1):
300 tokens 124.3 -> 124.3, 1,000 159.4 -> 159.5, 2,048 208.8 -> 270.4 (x1.295), 8,192 270.3 -> 304.2 (x1.125).
Still to do before this is a default: forced-token KL against the FP16 path with the repeat-arm floor, cmake-cpu and the
settings register check, nothing-set byte-identical to the opt-in arm, STRATA_PF_FUSED=0 byte-identical to the old default,
a 3-start confirmation block on the 780M.
6d8e42886 is one commit on 0ee263992, which is already in this branch: string and comment text only in src/core/pinned.cu, include/strata/core/page_cache_drop.hpp,
tests/core/page_cache_drop_test.cpp and data/settings-register.json (6 lines out, 6 in). Nothing changed by hand.
The wording of the two engine lines and of the STRATA_NO_ARENA_THP register note is approved as it stood. This commit removes the
"[DRAFT] " marks and changes nothing else:
- the arena line's ending is "; huge pages not requested on this graphics chip";
- the give-back line reads "strata generate: the model files' cached pages were given back after the expert load: <X> GiB asked back
during the read, <Y> GiB by the call after it (<N> ms); the file cache is <Z> GiB now (STRATA_NO_ARENA_CACHE_DROP=1 keeps it)";
- the STRATA_NO_ARENA_THP register note starts at "unset: the engine decides ...".
tests/core/page_cache_drop_test.cpp checks the new start of the give-back line; one comment in page_cache_drop.hpp lost its
reference to the wording list.
f-int-tidy = bb1bdb4da + 46b3013f9 (conversation cache and park pool tests ON in the cpu-check preset, +8 tests), ab38d9298 (the packer's import
probe writes no bytecode, +3 tests), 02020478b (a dead "multi" check removed from serve/server.py), 6f1613cc1 (tools/cuda_spill_baseline.json: the
known spill violations per architecture, +24 tests), f55afa152 and 4e9dde87e (the owner-approved log line "the graphics driver paused the GPU for
N ms between requests ..." on AMD under Linux, gpu_pause_time.hpp and three call sites in generate.cpp). Merged with the integrated-graphics
arrival before it; generate.cpp merged without a conflict, nothing changed by hand.
On a Radeon 780M (gfx1103) under Linux the expert arena (31.6 GiB of the Q2_0 pack) is filled with buffered reads of experts.bin and registered
with the driver (a KFD userptr). The GPU's own buffers take about 12 GiB of the same RAM, and the file cache of the model files the start read
fills most of the rest: MemFree 1.6-2.4 GiB and Cached 6.9-7.6 GiB at READY. With that little free memory, broken into small blocks, the
kernel's proactive compaction (kcompactd, fragmentation score above its high mark) scans and migrates the node's pages in passes: one right
after the fill and, when a pass made no progress, the next one 32 s later (500 ms << COMPACT_MAX_DEFER_SHIFT). A pass that moves pages of the
registered arena makes KFD evict the process's queues, and the gc 11 MES firmware never answers the eviction while a dispatch sits in a barrier:
the late stalls of an 8K prompt (30-50 s after READY) that the wait before READY does not reach.
Passive starts (no request) under a g++ load, settle build, 100 s of idle after READY, the daemon's scan counters read once a second: late
compaction passes in 3 of 8 starts (one of them evicted the idle engine's queues, evicted_ms +434 ms); the three have compact_daemon_migrate_scanned
moving with compact_stall, compact_daemon_wake and the kswapd counters flat (proactive compaction). In the failing starts of the 8K prompt
arm (b) the first late pass came 31-34 s after the end of the fill, in all four.
The engine now asks the kernel to drop the cached pages of the model files: posix_fadvise(DONTNEED) on each 8 MiB chunk of experts.bin right
after it has been copied into the arena (drop behind), and once per file after the load: the arena's expert files, the pack's dense.bin and
embd.bin, the GGUF shards of --native except the PLE table's (its rows are read directly). It is advice for clean pages: a file that is still
mapped keeps its mapped pages, a failed call is ignored, nothing is written or deleted. Nothing reads these files after the load but the
session fingerprint (the first and last 2 MiB of each model file) and an engine restart, which reads them from the drive again. Automatic on the
class of the huge-page and wait-before-READY rules (igpu_cache_drop_default: integrated gfx1103 / gfx1150 / gfx1151 under Linux); Windows,
discrete cards and every other device are unchanged. STRATA_NO_ARENA_CACHE_DROP=1 turns it off (research / A-B only, registered as research). One
[DRAFT] log line after the load says how much was given back and how long the final call took.
The harness version of the final call (posix_fadvise DONTNEED on experts.bin, dense.bin, embd.bin and the native shard right after the line
"expert arena read"), same passive starts: late passes 0 of 8, MemFree at READY 8.4-9.3 GiB (1.6-2.4 GiB without), free 2-4 MiB blocks at
READY 0.8-3.3 GiB (0.01-0.25 GiB without), READY 23.8-24.6 s (23.7-26.4 s without), the call 0.51-0.55 s. Loaded starts of the finished change
(g++ load beside the start, first request at READY + 0 s, 2K and 8K prompts, early in a boot, one Radeon 780M box): 9 of 9 passed with the
give-back, 10 of 14 with STRATA_NO_ARENA_CACHE_DROP=1.
Tests: tests/core/page_cache_drop_test.cpp (the flag and the switch, a range and a whole temporary file, every error path ignored, the final
call over a mixed list, the meminfo reader, the draft line) and the device rule in src/core/arch_defaults_test.cpp; settings register: one
hand-added entry (STRATA_NO_ARENA_CACHE_DROP, research).
On a Radeon 780M (gfx1103) under Linux the engine registers its 31.6 GiB expert arena with the driver (a KFD userptr). The load
that fills it keeps the kernel moving pages (compaction, reclaim) for about two seconds after the engine is up. Every move inside a
registered range makes KFD evict the process's GPU queues, and the gc 11 MES firmware never answers the eviction while a dispatch
sits in a barrier: the driver resets the GPU and the first prompt ends in "unspecified launch failure" (60 s hang). The kernel log
of every failed start shows the same sequence (MES failed to respond to REMOVE_QUEUE, Failed to evict queue, Failed to quiesce KFD
in most, GPU reset begin).
Before it prints READY the engine now waits until its own KFD eviction counter (/sys/class/kfd/kfd/proc/<pid>/stats_*/evicted_ms,
the milliseconds the process's queues spent evicted) has not moved for 2 s, at most 10 s. Where the counter cannot be read (no such
file, another kernel, a container with its own pid namespace) it waits nothing and prints nothing. No user setting and no line a
person sees. The device class is the one of the huge-page rule: an integrated gfx1103 / gfx1150 / gfx1151 under Linux
(igpu_kfd_settle_default); Windows, discrete cards and every other device are unchanged. STRATA_NO_KFD_SETTLE=1 turns it off (a
research switch for A/B runs, registered as research).
Measured on one Radeon 780M box (Q2_0 pack, Linux kernel 7.0, one engine at a time, setup's environment, 2K and 8K prompts):
- g++ load beside the start, first request right after READY: 3 of 10 starts passed (5 failed in the first seconds after READY).
- the same load, the harness sending the first request 30 s after READY: 5 of 5; waiting until the counter had been quiet for 2 s
(waits 2.0-3.4 s, mean 2.4 s): 8 of 10; the failures of the first seconds went from 5 of 10 to 0 of 15. The counters show the
movement ending within about 2 s of READY and nothing after.
- the engine's own wait, quiet, build with and without STRATA_NO_KFD_SETTLE=1: READY 23.0-23.5 s against 21.1-21.3 s (+2.1 s), speed
unchanged within the spread; quiet starts with the wait: 9 of 9 passed.
Late stalls inside a long prompt (layer 17-25 of an 8K pass, 30-50 s after READY) are a different class and are not addressed here.
Tests: tests/core/kfd_settle_test.cpp (the counter file missing, unreadable, garbage, a counter that moves, a counter that is quiet, the
cap; the folder reader on a temporary folder; the engine's call with the flag down) and the device rule in
src/core/arch_defaults_test.cpp; tools/check cmake-cpu on a Linux CPU runner: 75 passed, 0 failed (kfd_settle_test, arch_defaults_test and
stream_watch_test among them); tools/test_settings_register.py 8 OK, settings_register.py --check clean (one hand-added entry).
On a Radeon 780M (gfx1103) under Linux the engine registered its 31.6 GiB expert arena and asked for transparent
huge pages on it whenever enough free 2 MiB blocks existed. Huge-page compaction and collapse inside a registered
range invalidate it; KFD then evicts the process's queues, and the gc 11 MES firmware resets the GPU when a dispatch
sits in a barrier. The prompt then ends in "unspecified launch failure". One Radeon 780M box (Q2_0 pack, Linux kernel 7.0), one engine at a
time: huge pages requested in 9 starts, 8 failed in the first prompt; not requested in 3 starts, 3 ran.
Setup already wrote STRATA_NO_ARENA_THP=1 for its 780M opt-in. This makes it the engine's own rule, detected from
the device (integrated, and gfx1103, gfx1150 or gfx1151), on Linux only. No new setting: STRATA_NO_ARENA_THP unset
lets the engine decide (this rule, and every other device as before); any value but 0 skips the request as before;
0 now asks for the huge pages, also on these GPUs (it used to skip them like any other value). The SYCL arena reads
the variable the same way. Windows and discrete cards are unchanged. The arena line's new ending is a [DRAFT] for
the owner's wording. Unit test: arch_defaults_test (the device rule and the variable's three states).
The paused-GPU counter of the AMD driver was read only when a request began and when
it ended, so a pause between two requests, or while the engine sat idle after READY,
showed in no line. The engine now also reads the counter at READY and when each request
ends (whichever way it ends), and when the next request begins it prints one line if
the counter moved by 100 ms or more in between:
strata serve: the graphics driver paused the GPU for N ms between requests while Linux moved memory the GPU uses
The bar is the one the per-request line uses. A failed read leaves no mark, so two
unrelated counters never make a gap, and a counter that went back prints nothing. The
begin-of-request read is the one that was already there; the other builds (no HIP, not
Linux) read nothing. Diagnostic only: no new setting, no change to any existing line.
gpu_pause_time_test gains the line's cases and a sequence test of the bookkeeping
(GpuPauseIdle).
One commit on 5aa7f1d88 (in this branch). Owner: OK to take it (11-12). Lane gates as relayed: cmake-cpu 78 / 0 / 4, device code 3,852 functions
identical on sm_86, decode speed ratio median 0.998, stop turns left with unreturned tokens 49 of 56 -> 37 of 56, cap rows 0 of 19, pipelined
stop turns identical 18 of 18 on / off. No conflict, nothing changed by hand.
When the server ends a pass (a stop string, a client that left, a repeat or loop stop) it sends STOP and throws away every token that comes after it. The engine
sees STOP only at the end of a window, so the window that was running had already committed its rows: the session ended one or two windows past the tokens the
client was sent, and the next request of the conversation could not continue from it (the state is recurrent and cannot be cut back) and fell back to the newest
checkpoint, reading the cut reply again.
A window that finishes with STOP already set is now neither committed nor printed, in the serial loop and in the pipelined loop (a front stage that the speculative
window ran on goes back to the snapshot taken before the dropped window, with no replay). Not dropped: a merged window, the request's first window, and a window
whose state the one-token path advanced itself (Verifier::commit_deferred()). A request that ends by its cap or by EOS never sets the flag and takes the path it
took before; the cost in the loop is one flag read per window. The tokens a client receives do not change: the rows dropped were never sent.
STRATA_SERVE_STOP_SKIP=0 turns it off (research switch, on by default; register entry added). The decision is a pure function in serve_stop_bound.hpp with a unit
test (decision table and a ledger of the loop).
Part of lane AGENT-CAP (candidate C).
l620, 11-12, three runs per arm: with the arena at min(1 GiB, B / 8) the park of a
new 55K-token conversation beside three older parked ones stays at 283-291 ms
(K/V resize 205-213 ms: the arena is full of the older images, 47 misses of 372
allocations); with 2 GiB (a 16 GiB cache) it is 117-118 ms (K/V resize 41-44 ms).
Parks up to 20K are the same with either (35-59 ms).
Sizes now (park_pool_policy.hpp): segment pool min(2 GiB, B / 4) in 64 MiB steps,
none under 128 MiB; ready checkpoints as many as fit in B / 12, at most 4. At the
automatic cache sizes: ~8 GiB free RAM -> 2 GiB cache -> 512 MiB + 1 ready;
~12 GiB -> 3.75 GiB -> 960 MiB + 2; ~20 GiB -> 7 GiB -> 1792 MiB + 4; 40 GiB or
more -> 8 GiB -> 2048 MiB + 4. At most a third of the cache is held idle (30% at
8 GiB, 2.4 GiB); it is given back first (before any parked conversation is
evicted, before the RAM floor), and filled only while the cache budget and the RAM
floor plus 1 GiB leave room. Unit tests: the sizes at 8 to 200 GiB free and small
explicit caches.
Owner's go 11-11: the segment pool and the checkpoint pool with ready
checkpoints are on unless switched off. No user setting: STRATA_PARK_SEGPOOL_MIB=0
and STRATA_CKPT_POOL=0 are diagnostic switches, a value you set is kept.
Sizes (park_pool_policy.hpp, from the conversation cache's budget B): segment
pool min(1 GiB, B / 8) in 64 MiB steps, none under 128 MiB; ready checkpoints
as many as fit in B / 12, at most 4. At the automatic cache sizes: ~8 GiB free
RAM -> 2 GiB cache -> 256 MiB arena + 1 ready; ~20 GiB free -> 7 GiB cache ->
896 MiB + 4; 40 GiB or more free -> 8 GiB cache -> 1 GiB + 4. At most 21% of the
cache is held idle. Cache off: no pool.
Idle memory is accounted in the cache's budget (arena resident bytes no image
uses, plus the kept checkpoints) and given back before any parked conversation
is evicted (ConversationCache::make_room), before the park's physical-RAM
checks refuse or skip (shrink, then release_free_heap, then evict), before a
session save or load, and the top-ups run only while the budget and the RAM
floor plus 1 GiB leave room.
What the default means per OS and build (not the same everywhere, on purpose):
* Linux CUDA / HIP: both pools on.
* Windows CUDA / HIP: the checkpoint pool on; the segment pool is NOT created
(its OS layer, VirtualAlloc + pre-touch, is not written; reserve() returns
nothing and the arena is inert) until that exists.
* macOS (Metal build): neither is on by default (not gated there).
* A layer-split serve (several stages): the checkpoint pool is not on by
default (as READY never applied to it); the segment pool is.
Tests: park_pool_policy_test (sizes at 8, 12, 20, 40, 200 GiB free and small
explicit caches), the existing pool and cache tests.
ConversationCache::set_pool(): resident_bytes() = images + the pool's idle
bytes; make_room() gives idle bytes back before and after it decides what to
evict, and its eviction decisions read the images only, so a cache with a pool
evicts, refuses and parks exactly as a cache without one. bytes() stays the
images' figure. Tests: the accounting, the excess given back with no eviction,
and a 4,000-step random workload against a cache without a pool (every answer,
size, eviction count and byte count equal; images + idle + incoming inside the
budget after every successful make_room).
ConversationBuffer's segment allocator asks the process-wide pool first (a
segment of 512 KiB or more that finds a free run) and falls back to
::operator new; the way back decides by pointer. No pool is installed, so
nothing changes until the engine switch (a later commit) creates one. Test: a
real-sized 2K and 64K image alternating (the second 64K image is served
entirely from the pool), a pool smaller than the request, appends and moves,
bytes checked after every step; run with ASan and UBSan.
STRATA_PARK_SEGPOOL_MIB (research, coming in the next commits): one reserved,
pre-touched region cut into 256 KiB granules that serves any host buffer
segment of 512 KiB or more, best fit with coalescing; a freed range stays
resident. The OS side (reserve / commit / populate / release) is an interface
so a Windows implementation can follow; Linux uses mmap NORESERVE,
MADV_POPULATE_WRITE and MADV_DONTNEED. A filler thread tops the pool up while
a permit callback allows it. Nothing calls it yet.
One conflict, CMakeLists.txt: both sides add a ctest block at the same spot of the
STRATA_BUILD_TESTS list (main's gpu_pause_time_test, f-ok-reader's reader_room_test).
Resolved by keeping both blocks, the existing one first.
P2 ended the budget's first pass exactly at the budget for a solo request; a --batch engine kept the old behaviour (the server sent no hold to it), so there the second pass still read the whole reasoning again in 8-9 of 21-24 budget turns (p1004, --batch 2: base 9 of 24, head 8 of 21, PERF-AUDIT's R9700 and l620 runs the same shape).
Engine (src/program/generate.cpp, include/strata/core/serve_stop_bound.hpp): a slot carries the hold (SlotHold: on / n / id). BGEN hold=N:ID is parsed by the GEN path the admission runs; at the handover the slot takes the hold unless the admission's one token was </think>, and an admission whose hold is that one token ends there (DONE hold, no slot). In the slot windows the rows a window may commit stop at the hold (slot_cap(), in the MTP window, the pipelined MTP window's proposal count and the DFlash2 draft count), a slot ends with BDONE hold after exactly N emitted tokens unless ID was emitted first, and its sessions then hold exactly the tokens it fed, as in the solo case. The cap is the conservative one for a window that might emit ID: it stops at the hold and the next window goes on. READY says "stop hold holdb"; "holdb" is a protocol token only (no user-visible line, no setting).
Server (serve/server.py): the budget sends the hold to a --batch engine only when its READY says holdb (can_hold_batch); generate_batched adds the key per leg with the tokens the pass has already sent taken off (a solo leg promoted to a slot continues with hold=N-k, none once </think> was sent), and a leg that ends with finish "hold" ends the pass.
Tests: tests/core/serve_stop_bound_test.cpp (slot windows of changing width against a per-token reference over a whole reply: 75,360 cases; same tokens, same finish, no row committed past what was emitted, the hold ending at exactly N unless ID came first); serve/test_thinking_hold_batch.py (a fake --batch engine with the hold: solo path, a request admitted into a slot, a solo leg promoted to a slot with the count falling, first-N tokens of the unheld reply for N = 1 ... 53, hold ended by its token); serve/test_thinking_hold.py (stub engine with holdb).
The slot-model case failed on its first run (first=0 hold=1 max_new=3 id_at=0: got 7777 101 103, reference 7777 101 102). The test model was wrong, not the engine: it read a window's rows with `produced`, which it increments while the window is emitted, so it skipped a row; the engine emits from fixed arrays (outb[first + j]). Fixed in the test with a base index; the engine code was not changed by that run.
Mixed versions, both covered: new server + old engine (an engine without hold, and one with hold but no holdb, get no key when they run --batch; the budget cuts and STOPs as before) in test_thinking_hold.py, and old server + new engine (the extra READY tokens change nothing it reads, a request without a key runs as before through the solo path and through a slot) in test_thinking_hold_batch.py. Real-engine cross runs of P2 (head engine + base server, base engine + head server) were done on p1004 before this commit.
Lane AGENT-TURN, P2b.
In the resident RAM mode (--resident-experts, --resident-budget-gib, which
setup writes for Unsloth's UD-Q4_K_XL below about 71 GB of RAM and for the
low-RAM mode, or the start's own fallback when RAM is short for the arena)
the expert cache refuses the server's VRAM command ("VRAM: not with the
resident low-RAM mode"). With the on-demand reader and only setup's 700 MiB
reserve, the reader then found about 425 MiB free and every picture went to
the processor reader: 7.67 / 6.15 / 1.49 / 1.43 s against 2.06 / 0.93 /
0.41 / 0.37 s with the room held back (l620, IQ3_S, card held to 32 GB,
--resident-budget-gib 40).
The engine knows that mode before it sizes the cache, so there it keeps the
reader's 2,048 MiB in the reserve (strata/core/reader_room.hpp, applied
once after the arena / file pass loop, before the cache is sized; the mode
is not entered later). Only an engine with --vision, --vram-elastic,
--serve and the resident RAM mode changes; a larger reserve is never
lowered. One engine log line says it; no setting, nothing for the user.
Gate on l620 (same setup, 3 starts each, alternating):
- new default with the rule: the reader on the card in 3 of 3 starts
(1,509 MiB), 12,068 slots, pictures 2.06-2.45 / 0.91-1.08 / 0.39-0.59 /
0.37-0.55 s, text 1,714-1,722 / 3,867-3,882 tok/s at 2K / 8K;
- old default: the reader on the card in 3 of 3, 12,068 slots, pictures
2.07-2.37 / 0.91-1.09 / 0.39-0.59 / 0.37-0.55 s, text 1,719-1,740 /
3,873-3,889 tok/s.
Without the resident mode nothing changes: the same 12,719 slots, the same
answers to the same prompts and pictures, the shrink path as before, the
rule's line absent (one start each, engine before and after).
Test: reader_room_test (ctest; the rule's eight input combinations and the
larger-reserve case).
At the thinking budget the server cut the stream, STOPped the engine and sent a second engine request: the same prompt + the tokens it kept + the wrap-up. The engine sees STOP only at a window's end and commits each window before sending it, so it often held one or more tokens past the cut; its live session was then not a prefix of the second request, which fell back to the checkpoint before the assistant turn, parked the live branch and read the whole reasoning again (lane PERF-AUDIT, R9700 0.1.59: 4 of 9 budget turns, 535 tokens, 849-1000 ms against 85-96 ms).
Engine: GEN key hold=N:ID ends the request after N emitted tokens unless token ID (</think>) came first; the commit is capped there (serve_hold_remaining() + serve_stop_bound(), tested against the emission loop in serve_stop_bound_test), DONE finish "hold", READY says "stop hold". Without the key nothing changes; an older engine skips the key.
Server: sends hold=<budget - thought>:<</think> id> (HOLD_KEY, its own key, never a client's) only to an engine that says hold in READY, has no --batch slots and is not a multi engine, and only when </think> is one token. At DONE hold it wraps up if the point is clean; if not (a character split across tokens, a tag held back) one more pass from the live session with a hold of the tokens left (at least one). The second pass then reads the last token and the wrap-up only. Tested with a windowed stub engine in serve/test_thinking_hold.py: the answer is the same with and without the hold for every budget; an engine that does not say hold gets no key; one that says it but ignores it gives the same answer.
--batch engines (BGEN slots) are a separate path: not covered here, no hold is sent to them.
Lane AGENT-TURN, P2.
serve_stop_bound() caps the accepted rows a decode window commits at the rows the request can still emit (max_new) and at the first EOS, so the conversation the session keeps is exactly what the client got and the next continuation reuses it instead of falling back to the older checkpoint. It was compiled for HIP only, where it was measured (4 x R9700: 4 of 16 continuations fell back without it, 0 of 16 with it). It changes no emitted token; on CUDA it now applies too. STRATA_SERVE_STOP_BOUND=0 still turns it off (serve_stop_bound_on(), tested in serve_stop_bound_test). Host code only (generate.cpp is compiled as C++). The register entry's backend is now cuda-hip.
Part of lane AGENT-TURN (P1); the thinking-budget hold (P2) needs the bound on every backend.
On a GPU that shares the system RAM (cudaDevAttrIntegrated, the DGX Spark's GB10) CUDA counts only the RAM the kernel has
free: cudaMemGetInfo equals MemFree, not MemAvailable (measured: 62.59 GiB free = MemFree, MemAvailable 118.77 GiB). The
start reads every expert of the GGUF into the cache through the mapping, and those 47 GB of pages stay in the page cache
as a second copy of the cache's bytes. At READY the box had 1.3-1.6 GiB of MemFree, and the picture reader's own CUDA start
failed ("CUDA error: out of memory ... cudaSetDevice") in most starts, so a 2048x1536 picture took 91-105 s on the CPU
reader instead of about 3 s on the card.
When every expert is in the GPU cache on such a device (one GPU, the GGUF read in place), the engine now gives those
pages back after the prompt path is set up: madvise(MADV_DONTNEED) and posix_fadvise(DONTNEED) per expert blob, whole
pages inside the blob only. The experts of the slots the prompt path borrows keep their pages, because the refill after a
borrowed prompt reads them again. The cache holds the same bytes either way, so no output bit changes.
STRATA_UMA_DROP_PAGES=0 keeps the pages (for A/B runs).
Conflict: tools/test_setup_llama_archive.py, deleted on f-own-int (e43ff9885, no llama.cpp archive
download in the own stack) and changed on main (fd40eb0fd, its urlopen mock moved to netpolicy):
kept deleted.
The amdgpu driver suspends all GPU queues of a process while the kernel moves
or reclaims host pages the GPU maps, and counts the time per GPU in
/sys/class/kfd/kfd/proc/<pid>/stats_<gpu id>/evicted_ms. On p620 a slow
prompt read lost about exactly that time (RESULTS-GH-URGENT, option 1) and no
log showed it.
- include/strata/core/gpu_pause_time.hpp: header-only reader (sum over the
process's GPUs; a missing, unreadable or non-numeric counter = not
available, -1) and the two lines.
- generate.cpp: read once when a request begins and once at its end (a line
only when the request saw >= 100 ms), and in each pass of the stall report
beside the memory line (the change over the report's 2 s). HIP on Linux
only; every other build returns "not available" and prints nothing.
- tests/core/gpu_pause_time_test.cpp: fake KFD tree (present, several GPUs,
missing, unreadable, garbage) and the line formats.
Both lines are the owner-approved wording of 11-11. The test also reads a
missing KFD tree 10,000 times: not available, no line, mean cost printed.
serve STOP on a closed pipe, the launch worker after quit, the stall report
asks the prompt's GPU work, ISA-floor parity legs, the sleep stand-in, a
Windows child in the kill-on-close job before it runs, and the approved
wording of their lines.
Conflict: CMakeLists.txt, where f-gh1110 and this branch both add test
targets after batch_telemetry_test (conversation_heap_test and
stream_watch_test). Both blocks are kept.
The line for a free-memory query that failed (#5708) and the clamp line of
the automatic RAM copy now read as the owner approved them on 11-11; the
placeholder markers are gone. The four other messages that named
--resident-budget-gib on the automatic path name "the automatic RAM copy"
there; with the flag given they stay byte for byte. resident_ram_copy_test
checks the automatic clamp line in full.
The stall report's three lines about the prompt's GPU work and the error a
Windows start raises when the suspended child cannot be resumed now read as
the owner approved them on 11-11; the placeholder markers are gone.
stream_watch_test checks the three lines in full.
The engine read STRATA_RESIDENT_PIN only while parsing --resident-experts
and --resident-budget-gib. When the expert arena does not fit and the
engine takes the RAM copy by itself, the fallback set the pin
unconditionally, so STRATA_RESIDENT_PIN=0 left that copy page-locked
(the #5718 cap test's arm Z: "page-locked and mapped" with the variable
set). On the same path the clamp line said "--resident-budget-gib 47.07
exceeds available RAM" although no such flag was given.
New header include/strata/core/resident_ram_copy.hpp:
resident_pin_from_env (one reading of the variable: "0" pageable, unset
or anything else page-locked, as the two string compares before),
auto_ram_copy_mode (the fallback's mode, now reading it) and
resident_clamp_line (the clamp line by where the budget came from).
generate.cpp's two flag branches and the fallback use them; generate
tells the file source the budget is the automatic one
(FileExpertSource::budget_is_automatic) before pin_cache_complement.
Unset variable: the same mode and the same bytes as before on every
path except the automatic copy's clamp line. That line now carries a
placeholder wording marked [DRAFT] (resident_ram_copy.hpp, the
Automatic case); the flag's line and the what-fits line are unchanged
byte for byte (checked by the test).
Test: tests/core/resident_ram_copy_test.cpp (cpu-check). On the old
behaviour (the fallback's pin always on, the flag's line for any
budget) it fails 5 checks; now it passes.
A prompt read waits in cudaStreamSynchronize on its compute stream
(prefill.cpp, "waiting for the GPU (attention, router)"). When that wait
never returned, the watchdog's stall report and the release after it asked
only the verify window's streams, so a GPU that never finished the work
could not be told from a host that was not woken after it had finished
(#5718 follow-up).
New include/strata/core/stream_watch.hpp: a small list of the streams a
host may be waiting on. Prefill::run_impl names its compute stream there
while it reads; stall_report (both passes, before the release) prints one
line per named stream from cudaStreamQuery: finished, still running, or the
query's error. Works through the HIP shim and metal_compat (cudaStreamQuery,
cudaErrorNotReady). The line's wording is a PLACEHOLDER marked [DRAFT],
pending review.
Test: tests/core/stream_watch_test.cpp (cpu-check; faked queries, no GPU).
A ConversationBuffer's segments are plain allocations of up to 16 MiB. Once
glibc's dynamic mmap threshold has risen (the first freed segment raises it)
they come from the heap, and free() returns only the heap's top: an entry
below a newer one stayed resident, so the physical-RAM gate evicted every
parked conversation and still refused ("evicted 2, 0 still parked"). Two
comments said the opposite.
evict_oldest() now calls release_free_heap() (glibc: malloc_trim(0); a no-op
elsewhere) after dropping the entry; make_room() keeps dropping entries without
it (drop_oldest), as the image allocated right after reuses that memory. The
admission gate in generate.cpp also hands freed memory back once before it
evicts anything, so memory freed by make_room or dropped checkpoints counts.
Nothing changes while the gate admits at the first check.
Test: src/core/conversation_heap_test.cpp (cpu-check). Boston, glibc 2.39,
3 x 512 MiB parked, evict the oldest: before 0 MiB returned (RSS 1539 ->
1539 MiB, 0.01 ms); after 511 MiB returned (1539 -> 1027 MiB, 8.8-9.3 ms).
The 8.0-and-up rule (nv_chunk.hpp) left Volta at 8192 as "not measured". Measured on one Tesla V100-SXM2 32 GB (gen3 x8 link, UD-Q4_K_XL,
33% of the experts in VRAM), 5 alternating pairs of 8192 against 32768: 4K +0.3%, 8K +0.2%, 20K +134.1%, 32K +111.2%; decode after the prompts unchanged;
first-token KL mean 3.7e-5 (20K) and 4.0e-4 (32K), top-1 13 of 13. Turing (7.5) and Pascal (6.x) keep 8192; a layer split keeps 8192 (four V100s read a
20K prompt 27-30% slower with larger chunks). nv_chunk_card_ok takes the lowest card's major and minor; the unit test pins 7.0 yes, 7.5 and 6.x no.
On Windows HIP, an auto expert cache with no --vram-reserve-mib kept a floor of 2560 MiB free on any card of 15 GiB or more (#1376, made for a 20 GB discrete
card that paged). On a Strix Halo that room is not free: the RAM budget's page-locked complement takes it straight back (cache + complement 71.72 GiB at 2560 and
71.73 GiB at 700 on UD-Q4_K_XL), so the prompt path's own buffers found 0 MiB and the engine stepped its chunk down 16384 ... 1024 for ever; strata launch of a
UD-Q4_K_XL config with no reserve (pictures off, or a model with no picture reader) never started.
The floor now goes through strata::core::wddm_auto_reserve_mib(integrated, total, current, floor): a discrete card of 15 GiB or more still gets 2560, an
integrated GPU (the device property the UMA sizing already reads) keeps the engine's default 700. Discrete cards, Linux and every config that passes
--vram-reserve-mib are unchanged (the block is under _WIN32 + STRATA_USE_HIP and behind !vram_reserve_given). Unit test in uma_cache_test.
CUDA sm_120 sm build (vendored ggml), base vs change from the same path: the binaries are bit-identical (sha256 2b603395...).
Strix (gfx1151, public-0.2.12-style config with no reserve) with the new engine: starts in 77 s and answers 3 chats; the old engine never started it.
Strix Halo (gfx1151): engine cap 5 -> 8 and the Terminal writes --spec 8; conf stays 0.35.
Measured (5 interleaved pairs, 5/5 faster): UD-Q4_K_XL +5.3%, UD-IQ4_XS-v31 +2.1%.
UD-Q4_K_XL greedy output differs from the old width's (deterministic run to run); v31 is identical.
Blackwell sm_120 (cc 12.0) with at least 48 GB: cap 6 -> 8, --draft-conf 0.55 (RTX PRO 5000 72 GB,
IQ3_S +2.4%, 5/5 pairs, output identical). The DGX Spark (cc 12.1) and consumer cards under 48 GB keep
conf 0.35 and cap 6. dflash2_auto_cap now takes the compute minor and the card's memory; drafting.py
writes --spec 8 only on these two classes (window_for), so no other card's effective window changes.
draft_cap_test, tests/terminal drafting tests (new test_drafting_card_window.py) and the snapshot
goldens (nv_resident and strix_halo_win only) are updated.
The warning now reads "the experts need X GiB of RAM and Y GiB is free, but free memory, file cache and reserved huge pages can hold
them, so they load anyway (same answers). STRATA_ARENA_FILE_CACHE=0 reads them from the file instead." It and the "not enough RAM for
the expert arena ... reads the experts from the file" notice go to stdout only with --serve (before READY, which the server ignores; a
service log has them). A plain generate run keeps its token stream clean: stderr only, as before the PR.
Review of #5531 on top of the contributor's two commits. The credit read Cached - Shmem - Dirty as droppable, but file pages the
process itself or an engine still exiting has locked (the PLE table's mlock is a mapping of the model file) sit in Cached and the kernel
cannot drop them; MemAvailable leaves them out. An engine with --ple-io ram and a short arena was told its own locked table could serve
the arena - the shape of #4051's stall. Now: Mlocked is subtracted; HugePages_Rsvd is subtracted from the free pool; the pool counts only
at the 2 MiB size the arena maps; STRATA_NO_LARGEPAGES (no MAP_HUGETLB try) credits no pool; and the pool must hold the padded mapping
(the pin-by-need stride padding plus the spare blob), not want + blob. Tests for each.