mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#948
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 @yorunoken on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2344
Summary
Linux/HIP prefill regressed after v0.1.40.1 and remains affected in v0.1.44 (
ed4773eb). Testing 805088d5 against its immediate parent isolates the slowdown to Linux expert file-cache selection.STRATA_UNBUFFERED_LOAD=1restores performance on the unmodified latest build.Related: #1682 and #1407, closed when v0.1.44 shipped. This adds current-version reproduction and a consecutive-commit comparison on one GPU.
Environment
RX 9060 XT 16 GiB (gfx1200), Ryzen 5 9600X, 32 GiB RAM, approximately 30 GiB swap; CachyOS kernel 7.2.9-2-cachyos; ROCm 7.2.4. Model: Qwen3.8-Flash-Next-GSQ-RCO IQ3_XXS. Identical pack, GGUF shards, expert profile, MTP and control vector across arms.
Measurements
4096 input / 64 output tokens, five fresh-process runs per commit:
58b1ea221aad1950597b40462be19daae24bc45a805088d5b61a95912c5d19797053339b9aa979f757.31% lower median prefill, with the same 4901 expert-cache slots / 7.95 GiB and no intervening HIP kernel change. Median peak RSS rises from 18,580 to 27,342 MiB.
At 4096 tokens, five warm repetitions, v0.1.40.1 defaults give 367.42 tok/s; v0.1.44 with direct I/O gives 343.51 tok/s, or 361.83 with
--aux-cpus auto.On v0.1.44 defaults, repeated 1024-token fresh requests deteriorate through 71.25, 81.30, 33.43, 17.73, 7.96 tok/s, then the next request hits the 60-second watchdog at layer 33. Fresh restarts can initially exceed 100 tok/s; the deterioration depends on cache/memory history.
Cause and workaround
The changed Linux heuristic requires cache room for only 5% of file-tier reads, at least 1.5 GiB, with a 1 GiB margin. Logs show it selecting buffered reads with about 9.7 GiB available for a 24 GiB read set after the 16 GiB resident copy. The parent instead selects unbuffered reads.
Broad prefill appears to defeat the decode-oriented hot-set assumption. During a stall,
perf statrecords 88,625 major faults in five seconds, copy threads wait infolio_wait_bit_common, and swap/reclaim counters rise sharply. The mode switch also changes staging concurrency, so its separate contribution remains uncertain.Reproduction
3cf03257f219afbe7334045ff7c6a06ac68c627d): PREFILL_MMQ/Q6K_EXPERTS on, MMQ_KQUANTS/CUDA off.--serve, sendingGEN 64 ckpt=0 temperature=0 <token-IDs>after READY. Check zero reused tokens and exact fresh counts. Restart five times for cold comparisons; use first request plus five repetitions for warm comparisons. Loading is excluded; OS caches are not globally flushed. Run sequentially without competing inference/builds.STRATA_UNBUFFERED_LOAD=1, keeping a resident budget. Unset timing/IO diagnostics for throughput.A fixed-cache check (
--expert-cache 3000 --adapt-every 0) gives 5/5 identical buffered/direct token-output hashes at 1024 input / 64 output tokens.Separately, direct I/O + aux affinity + the gfx1200 hipBLASLt 100202 tuning table reaches 604.16 tok/s prefill / 45.06 tok/s decode at 4096 tokens. Tuning changes some logits/output wording and is not required for the conservative workaround.
Could automatic expert I/O selection account for broad prefill working sets or measured I/O behavior? Full raw measurements/scripts are retained locally. Investigation was assisted by Codex; all performance numbers are from actual local runs.
@willthehuman commented on GitHub (Oct 14, 2026):
Confirming this on NVIDIA/CUDA, so it is not HIP-specific.
Setup: i7-8700, 31.9 GB RAM, RTX 4070 SUPER 12 GB, Q2_0 pack on an ntfs3 partition (DRAM-less NVMe), engine
0.1.44.1.Method: engine stopped, every model file evicted with
fadvise(advice defaults todontneed), coldness verified withfincorebefore each measurement, one identical 17,280-token prompt, two rounds with the arm order reversed on round 2. Medians of 2:STRATA_UNBUFFERED_LOAD=1: prefill 629.3 tok/s (628.6–630.0) · decode 69.2 · 340 major faults (338–343) · page cache held 0 MBSTRATA_IO_PREFETCH=1: prefill 460.9 · 42,559 faultsSTRATA_IO_PREFETCH=1+STRATA_IO_PF_STAGE=1: prefill 447.8 · 43,335 faultsThat is +43% prefill and 131× fewer major faults, reproducing across both round orders.
The part I think is most useful for the heuristic: the byte volumes are the same in every arm. Per request the file tier wanted ~44.2 GB of expert bytes and the OS delivered 66.0–67.1 GB from storage in all four arms. Only the read shape differs — buffered through the page cache versus unbuffered direct. Same bytes, 131× the major faults, 43% of the prefill.
The same prompt under each setting, from the engine's own per-request line:
Worth noting this is the box from #1194 — the 5% / 1.5 GiB rule came out of that report, and on 0.1.44.1 it is now the thing costing this machine 43% of its prompt speed.
One related observation: with
STRATA_LOOKAHEAD=0set,STRATA_IO_PREFETCH=1did essentially nothing here — the per-request counter read0–3 read ahead (0.0–4.1 MB by pread), 0 used. The prefetch path reads the layer's uncached experts and the router-predicted ones of the next layer, so with the lookahead off it has nothing to work with. Worth knowing before recommending prefetch as the fix for 32 GB boxes (as in #1407).Given #1682, is the intended direction still to time the drive at start and pick direct reads when the drive is fast and the cache covers only part of the read set? If it helps, I can run the same controlled protocol against a build with that timing in it.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@vthomasino commented on GitHub (Oct 19, 2026):
Re-tested on 0.2.0-beta (CUDA, RTX 5090 Laptop, 62 GB, UD-Q6_K_XL, caches dropped, two rounds): still happens. The default picks the file cache and reads prompts at about half the speed of
STRATA_UNBUFFERED_LOAD=1(179-185 vs 366-373 tok/s at ~4.5K tokens), and decodes at 3.4-6.0 vs 18.3-19.2 tok/s. Details, raw logs and a possible opt-in fix in #3237.