mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1696] [CLOSED] Resident RAM mode on Windows: the start-up fill and the RAM copy read experts.bin unbuffered (ready 42 -> 10 s with 21 GiB free) #3615
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#3615
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1696
Author: @sergqwer
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:pr/resident-unbuffered-start📝 Commits (1)
8d574eeResident RAM mode on Windows: the GPU cache's fill and the RAM copy read experts.bin unbuffered, the view closed meanwhile📊 Changes
3 files changed (+207 additions, -2 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+14 -0)📝
src/core/expert_source.cpp(+135 -1)📝
src/program/generate.cpp(+58 -1)📄 Description
With
--resident-experts(what setup writes in the low-RAM mode when the experts the GPU does not hold fit the RAM; the pack then hasexperts.binfromiq_pack.py --experts-bin), the start copies two things out ofexperts.binthrough its mapped view:pin_cache_complement(16.4 GiB here).Every page those copies touch sits in the engine's working set beside the page-locked copy, until #467's trim after the fill and the
VirtualUnlockafter the copy. #467's comment has the result on a real 32 GB PC: 20.7 GiB available before the start, 0.44 GiB after the fill. Windows pages other memory out, and the copies run at page-fault speed (~0.85 GB/s here).Change (Windows,
experts.binonly):FileExpertSource::begin_startup_unbufferedruns once the file tier is chosen, when that tier reads through the file cache.drop_mapping).open_direct) and reads the first blob both ways.prefetch_pairsbatches of 64, the next one while the current one is copied;read_directbatches of 32 blobs on 6 threads;end_startup_unbufferedruns right after the copy.map_view, with the file size checked).pin_cache_complementno longerVirtualUnlocks the address range of a closed view.STRATA_STARTUP_UNBUFFERED=0gives the mapped copy back (the A/B arm).STRATA_VERIFY_COMPLEMENT=1prints two checksums: the filled cache slots (read back from VRAM) and the RAM copy (with its offsets)._WIN32);begin_startup_unbufferedrefuses: it takes only one mappedexperts.bin;--resident-budget-gibon a small PC);A/B on current main
fb58e0dbvs this branch, both from the same build script (MSVC, CUDA 13, sm_120).iq_pack.py --experts-bin(33.0 GiBexperts.bin).--resident-experts --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --max-context 262144 --kv int8, plus--vram-reserve-mib 1500 --stop-eos.resident RAM mode:line, i.e. the copy done.A 32 GB PC, emulated:
fb58e0dbHow many base starts trip the watchdog depends on what the desktop holds at the time. A third series the same hour, with
STRATA_PREFILL_CPU_SHARE=0in both arms, had the watchdog stop 5 of 6 base starts and none of this PR's.128 GB, no ballast, 3 pairs:
fb58e0dbA restart with the file cached: the worst case for this change, since the mapped copy then reads RAM. Three base starts in a row, then three of this PR:
fb58e0db, coldfb58e0db, warm (x2)Identity:
--expert-cache 12000 --pcie-frac 0.25, no ballast.output :ids; logits are the md5 ofSTRATA_DUMP_FIRST_LOGITS.fb58e0db(x2)STRATA_STARTUP_UNBUFFERED=0fb58e0db/ this PR /=0=0)=0)--expert-cache 16000:fb58e0db/ this PR /=0=0)=0)fb58e0db/ this PRfile_expert_source_testpasses.Risks:
--resident-expertsonly when the RAM cannot hold the experts with room to spare, so the file is not cached there.--resident-expertsby hand keeps the old path withSTRATA_STARTUP_UNBUFFERED=0.drop_mappingtoday.the profile fill failed at pair N, as with an unbuffered tier today. In the RAM copy it reports that the copy does not fit, and the soft mode reads those experts from the file.SetProcessWorkingSetSize(-1, -1)inpin_cache_complement) leaves the engine to fault ~1 GiB of its own memory back in after the copy. That happens in both builds: the samples show 60-160 MiB read from the drive every 0.25 s for 2-2.5 s after theresident RAM mode:line.--expert-cache-per-layer, fill throughblob_stableone blob at a time, as with an unbuffered tier today. One card here: not measured._WIN32already exists there, and the call is not made.The same change in our fork measured, on a 63 GiB NVFP4 pack with 88 GiB available: ready 53.0 -> 17.5 s, peak working set 85 -> 47 GiB, pages written out 1,736 -> 0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.