mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3059] Windows file tier: reading experts through the file cache after load gave +26% decode on RX 7800 XT (opt-in patch) #1226
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#1226
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 @durikim1-cpu on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3059
What do you want to do?
Summary
When the Windows file tier reads unbuffered (chosen at load when the file cache cannot keep the experts, or forced with
STRATA_UNBUFFERED_LOAD=1, which both arms below set), every expert outside RAM and VRAM is read withFILE_FLAG_NO_BUFFERINGoncedrop_mapping()closes the views. On my machine (RX 7800 XT 16 GB, 64 GB RAM, Windows 11) I tried an opt-in changethat keeps the unbuffered handles for the initial load and then reopens
experts.bin(or the GGUF shards) withFILE_FLAG_OVERLAPPEDonly, so later expert reads can be served by the Windows file cache.Same binary, same day, only this switch changed,
STRATA_UNBUFFERED_LOAD=1in both arms (the unset and=0cases are not part of this A/B; with=0an earlier build of the same tree at 19 GiB stopped on my 4 GiB free-RAM guard during the first 60K request), 60,047-token fresh prompt (0 reused), three runs each:STRATA_R6_FILE_READ_CACHE=0STRATA_R6_FILE_READ_CACHE=1The generated text was identical pair by pair (345 / 381 / 340 tokens). Physical SSD reads fell from 947.9 to
306.7 MiB/s while reading the prompt and from 678.4 to 24.7 MiB/s while decoding, while the engine's requested read rate did not drop (947 → 987 and 678 → 818 MiB/s). A real coding-agent run (6 tasks × 3) went from a median
of 61.45 s to 50.31 s over the 18 runs, 18/18 functional in both.
Full report, per-run data and launch configs: the community benchmark folder
bench/results/2026-10-18-community-rx-7800-xt-windows/(PR #3057).This looks like the Windows counterpart of #1194 (Linux: cache vs
O_DIRECTon the file tier, fixed for Linux in0.1.40.2). It also touches the question in #2344, where the buffered path made prompt reading slower on some Linux
machines; here the prompt got slightly faster, but this is overlapped ReadFile through the Windows cache on one Windows machine, and I did not measure page faults.
What the patch does
r6-windows-cached-readfile.patch, againstv0.1.44.1, 57 added lines, one function(
FileExpertSource::drop_mapping,_WIN32branch).drop_mappingon today'smainis the same as in 0.1.44.1.STRATA_R6_FILE_READ_CACHE=1(the name is from my experiment; any name is fine). With it unset the codepath is unchanged.
unbuffered.
open_direct()and the startup unbuffered path are not touched.reopens every file with
FILE_FLAG_OVERLAPPEDonly, reads the same three blobs twice and compares bytes. If any openor compare fails, it closes the new handles and restores the original ones. The result is written to the startup log
line (
R6 Windows cached ReadFile active; ... byte-probe PASS (3 blobs x 2 reads)).read_direct()overlapped reads are reused unchanged.Caveats
build, but I have not measured the patch alone on top of a clean 0.1.44.1 or
main.#if defined(_WIN32)and has no GPU-backend code,but I did not build CUDA or SYCL.
64K context, int8 KV. With 64 GB of RAM there is room for the file cache; a machine with less RAM may behave
differently (the file cache competes with the resident arena and the commit limit).
them.
Question
Would an opt-in switch like this be acceptable for Windows, or would you rather fold it into the existing
cache-vs-unbuffered decision (as #1194 did for Linux)? If useful, I can open a PR against current
mainwith the patchalone and re-measure it on a clean build first.
Patch
Full experiment branch: https://github.com/durikim1-cpu/Strata/tree/rx7800xt-experiments
@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.