mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #230] The GGUF branch of load_experts_gguf still has the 4095-byte std::ifstream defect (0.02 -> 1.87 GiB/s, 42 min -> 54 s) #122
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#122
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 @activeing123 on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/230
The GGUF branch of
load_experts_ggufstill has the 4095-bytestd::ifstreamdefect (0.02 -> 1.87 GiB/s, 42 min -> 54 s)Follow-up to #89. That PR fixed the pack path (
experts.bin->load_experts_ranges, nowfread8 MiB). Its own description says:This is that report: a normal Windows install that never builds
experts.binhits the defect, and the fix that works today is to make the engine take the fast path.Summary
The engine's own line, same pack, same machine, only the pack contents changed:
Why this config is the one that hits it
ArenaExpertSource::openpicks the reader by whether the pack hasexperts.bin:setup.pyonly writesexperts.binin the low-RAM branch:So the comment "the experts are read from the GGUF at start (seconds to build)" holds only where
std::ifstreamissues bulk reads. On MSVC it does not, and the normal install takes the slow branch with noexperts.binto fall back on.load_experts_gguf(upstream main, lines 1107/1133):The arithmetic on this machine
The GGUF branch reads per tensor role in chunks of
per[r] * 16experts. For IQ3_XXS layer 0's gate tensor that is 7,686,880 B (7.33 MB) per read. On MSVC,basic_filebuf::xsgetnloopsfread(_Ptr, 1, 4095, _Myfile)(_Read_size = 4095), so:At the ~3.5 us/call this box shows, that is ~37 min of pure per-call overhead. The measured phase was 2,519 s = 42.0 min. The disk is not the limit: an unbuffered 1 MB sequential read of the same file measures 668 MB/s here.
Reproduction
Windows 11, MSVC 14.44.35207, CUDA 13.0, i9-14900KF, 64 GB DDR5-6000, RTX 5090 D v2 24 GB, ZHITAI Ti600 2TB NVMe. Pack: ISTA-DASLab GSQ-RCO IQ3_XXS (2 shards + PLE), 48 layers, 512 experts, arena 42,912,972,800 B. Engine 0.1.27,
--expert-cache auto --spec 4 --mtp ... --max-context 131072 --kv int8 --kv-resident 32768 --vram-reserve-mib 700.Measured across 3 full stop/start cycles of the real launcher (
.bat->server.py->strata.exe), timing from launch to/health= 200:Average 64.1 s, best 59.0 s, worst 74.3 s. Before: 2,519 s. ~39x.
Decode was checked so the fix is not confused with a speed change: same prompt 6 times in a row, steady state from run 3 = 32.34 tok/s (35.71 / 31.05 / 32.20 / 30.39), expert cache hit 93-96%. Consistent with what this box did before the fix.
Why nobody reported it
experts.bin(low-RAM mode, or a Q2_0 AVX-512 build) is on the fast path and sees 35-55 s.That text is about #126 (Task Scheduler, 0.05 vs 1.42 GiB/s). Here the process was started from a terminal at Normal priority - log line 15 (BelowNormal) and line 232 (High) are byte-identical at
0.02 GiB/s, and a disk-priority sweep (VeryLow/Low/Normal/High) showed no effect. The hint sent me after priority and large pages for a while; the real cause is the reader. Worth a separate hint when the load rate is under ~0.2 GiB/s and the pack has noexperts.bin.Suggested fix
Point
load_experts_ggufat the samefopen/fread+_fseeki64bodyload_experts_rangesnow uses (#89), or reuseload_experts_rangesby feeding it the GGUF offsetslay.gguf_offalready carries. The blob scatter step can stay as it is; only the read call needs to change. On this machine the pack path reached 1.83-2.04 GiB/s, so the GGUF path should land in the same range and the normal install would stop needing a 40 GBexperts.binjust to start in a minute.I am not attaching a patch - I have no MSVC tree here to build and verify against - but the measurements above should be enough to size it. Happy to re-run any measurement if useful.
@Niko1221 commented on GitHub (Sep 30, 2026):
Confirmed: the GGUF expert loader still reads through
std::ifstream. 0.1.31 switches it to the same 64-bitFILE*reads the experts.bin path uses.@Niko1221 commented on GitHub (Oct 1, 2026):
Fixed in 0.1.31: the GGUF expert reader uses 64-bit
FILE*reads; an IQ3_XXS pack without experts.bin loads at 3.2 GiB/s here instead of 1.5. Thanks for finding it!