mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3237] [Engine] Linux file tier: the room rule still picks the file cache on 0.2.0-beta, 2x slower prefill and 3-4x slower decode than unbuffered reads #1313
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1313
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vthomasino on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3237
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On 0.2.0-beta, with a model whose file tier is much larger than the free RAM, the automatic choice (
file_tier_unbuffered, the #1194 room rule) reads the experts through the page cache. On this machine that path reads prompts at about half the speed ofSTRATA_UNBUFFERED_LOAD=1and decodes at a third to a quarter of its speed, and the OS reads up to 3x the expert bytes from the drive. #1682 and #2344 reported this on 0.1.4x (#2344: +43% prefill unbuffered on an RTX 4070 SUPER with 32 GB). Both were closed in the 0.2.0 reset, so this is the re-test on 0.2.0-beta.What the engine chose by default:
Results, round 1 / round 2 (each arm a fresh server, page cache dropped before it, round 2 in reversed arm order; 2026-10-19 12:03-12:19):
STRATA_UNBUFFERED_LOAD=1Per-request lines from the engine log:
the OS read 180282.2 MB from storage (222370 major faults) for 60804.5 MB of expert reads; page cache held 38535.4 MB at the read(round 2:91715.3 MB ... (68704 major faults) for 31969.8 MB). Every logged request had 10,615 to 222,370 major faults.124989.5 MB ... (0 major faults) for 124529.8 MB, with 0 to 3 major faults per request.Expected: with 6 GiB free after the RAM copy and a 63.7 GiB read set, the cache holds about a tenth of what is read. #1194 measured the cache winning when it holds a twentieth or more of a skewed read set; on this drive and model it loses at about a tenth. (The opposite case, #577 on a 96 GB PC where the cache holds the whole read set, should keep the cache.)
A possible fix, offered, not assumed. I carry a local, opt-in check,
STRATA_FILE_TIER_PROBE=1. It runs only where the room rule picks the cache but the cache cannot hold the whole read set. It times the drive's direct reads (depth 8) and cached-path reads (depth 3) once at load, then reads unbuffered when the cache holds under 30% of the read set, or 30-50% with direct reads at least 1.5x faster. Here it loggedthe cache holds 13% of the read set, direct reads 8.18 GB/s at depth 8, cached-path reads 4.93 GB/s at depth 3 (1.66x), chose unbuffered, and measured:STRATA_FILE_TIER_PROBE=1The thresholds come from runs on this one machine with UD-Q4_K_XL and UD-Q6_K_XL, unthrottled and with the drive capped by systemd's
IOReadBandwidthMaxdown to 250 MB/s (on 0.1.45). If it is wanted, I can open it as a draft PR. It builds for CUDA; I have no HIP or SYCL toolkit, so those builds are not run. If a different rule fits better, the numbers are yours to use.Not tested: AMD/HIP, Windows, ext4, a slower drive on 0.2.0 (the throttled runs were on 0.1.45), a page cache warm from an earlier run.
Smallest steps or command that reproduce it
--resident-budget-gib 38on a 62 GB PC, with no file-tier variable set. The start log saysthe file tier reads through the file cache.STRATA_UNBUFFERED_LOAD=1.The script, the config and the raw output of both rounds: https://gist.github.com/vthomasino/aef6f8e2413733cbe149a91178e889d8
Reproduction status
Reproduced locally
Strata version
Strata 0.2.0-beta · engine 0.1.45.3 · tag v0.2.0-beta (
b73dbce3) plus one local commit of opt-in code (STRATA_FILE_TIER_PROBE, STRATA_FILL_SPANS, a debug trace), not active in the default and unbuffered armsGraphics card, memory and system
RTX 5090 Laptop 24 GB (driver 610.57.04, CUDA 13.2) · 62 GB RAM · Core Ultra 9 275HX · Samsung 9100 PRO 2 TB PCIe 5.0, btrfs · Linux 7.2.5 (Omarchy/Arch)
Model, size and settings
unsloth UD-Q6_K_XL (158 GB GGUF read in place) · 256K context · pictures on ·
--resident-budget-gib 38 --kv int8 --kv-resident 131072 --spec 4 --mtp --pool-workers 15 --vram-reserve-mib 1700, envSTRATA_MMQ_KQ=1 STRATA_HC_Q8=1Logs
The engine's choice and per-request lines for every arm are in
ab-q6-020.outin the gist above.@Niko1221 commented on GitHub (Oct 20, 2026):
Thank you for the offer of the probe and for the numbers. We cannot reproduce your regime: every drive we have reads 1.6 to 3.1 GB/s, and there the file cache was better for decode (up to x1.6), unbuffered reads better for prompts. Your ratio of direct to cached reads (1.66x) also matches a slow drive of ours, so a ratio alone cannot tell the boxes apart. 0.2.1 adds a probe at start, on by default (96 random 1 MiB pieces both ways, under 2 s), that goes unbuffered only when the drive reads at least 4 GB/s and is faster that way; the log prints the numbers, and STRATA_FILE_TIER_PROBE=0 turns it off. Could you run 0.2.1 and send that log line, with your prompt and decode speed?
This is in Strata 0.2.1: https://github.com/Niko1221/Strata/releases/tag/v0.2.1
@chiangww commented on GitHub (Oct 20, 2026):
Rig: Ryzen 7 7700X, LXC with 46 GiB RAM, RTX 5070 Ti + RTX 5060 Ti (2-GPU layer split 32), Qwen3.8-Flash-Next UD-IQ4_XS (expert arena 55.4 GiB),
--resident-experts --resident-budget-gib 32 --kv k8v4 --spec 5, model on a local NVMe (PCIe 4.0 x4 drive in a PCIe 5.0 x4 slot, ext4 on LVM-thin). Engine 0.2.1 (engine binary 0.1.46.1), source build.Startup line, verbatim:
So the room rule said "cache" while the cache could hold only 45% of the read set — exactly the case the probe was added for. Same config, same interleaved long-prompt ramp (8 lengths, 13.5K-120K fresh tokens), engine versions only:
The
file tier I/Oline now reports OS-read ~= expert-read 1:1 (every byte read once, honestly), andSTRATA_IO_PREFETCH=1self-disables with "Linux mapped file tier only, not with unbuffered reads" — noted.Mechanism fits: with a 32 GiB page-locked RAM copy the page cache is squeezed to ~10 GiB, so the cached path pays a 2 MiB THP fault plus reclaim churn on almost every read — measured ceiling 2.65 GB/s against the drive's 6.55. On this rig the O_DIRECT flip is the single biggest speedup since layer splitting; the #669 "lend slots have no RAM copy" WARNING is harmless once reads are direct.
Two notes:
STRATA_UNBUFFERED_LOAD=1skips the probe and pins the choice (fine when the model lives on a fast local drive; I keep the probe for the NAS copy). And the probe's <2 s cost is invisible next to a +73% prefill — this drive class (the >4 GB/s gap in your table) says: keep it on.@vthomasino commented on GitHub (Oct 20, 2026):
Ran 0.2.1 as shipped (source build, no local patches), engine binary 0.1.46.1, same PC and config as the report. The probe fires and picks unbuffered on its own — nothing set:
Same probe as my report (fresh prompt, 256-token decode, caches dropped first, engine 0.2.1 in both arms; only the file-tier choice differs):
STRATA_UNBUFFERED_LOAD=1(pins it)The two arms are equal within run-to-run noise: where the drive is this fast, the probe's choice matches the pinned one, and pinning adds nothing.
Against 0.2.0-beta on the same machine yesterday (my report above): the default then read through the file cache at 179–274 tok/s prefill and 3.4–6.0 tok/s decode; forced unbuffered gave 366–623 prefill and 18–19 decode. 0.2.1's default lands on the good path by itself, and prefill is another ~25-30% above yesterday's unbuffered arm (487 vs 366-373, 750 vs 601-623) — I have not separated how much of that is the 0.2.1 reserve change (#3215) leaving more experts in VRAM, so treat that part as one uncontrolled comparison.
Per-request line from the 13.4K probe:
the OS read 50964.4 MB from storage (0 major faults) for 50819.3 MB of expert reads— 1:1, no page-cache amplification.Environment: Ryzen none — Intel Core Ultra 9 275HX, RTX 5090 Laptop 24 GB, 62 GB RAM, Samsung 9100 PRO 2 TB (PCIe 5.0, btrfs), Linux 7.2.5 (Omarchy), driver 615.78.08, CUDA 13.2 toolkit. Model unsloth UD-Q6_K_XL (158 GB GGUF in place),
--resident-budget-gib 38 --kv int8 --kv-resident 131072 --max-context 262144 --spec 4 --mtp --vision --pool-workers 15.@Niko1221 commented on GitHub (Oct 29, 2026):
Thank you for the log and the numbers. Closing as fixed in 0.2.1: the start-up drive probe picks unbuffered reads on a fast drive, and your log shows it firing on its own.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.1