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#2598
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/362
Author: @sergqwer
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:pr/tier-unbuffered📝 Commits (4)
cb1bae3Start: read the expert arena unbuffered when the file cache cannot help (Windows; part 1 of #285)5095b35load_experts_gguf: the header declares the new parameterb8c7fb3File tier: read the GGUF in place unbuffered when the file cache cannot keep it beside the RAM budget (Windows; #286 ported into 0.1.31's tier)eae4dc1File tier: a pack's experts.bin is read unbuffered too (Windows)📊 Changes
5 files changed (+564 additions, -17 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+26 -2)📝
include/strata/core/pinned.hpp(+16 -0)📝
src/core/expert_source.cpp(+369 -15)📝
src/core/pinned.cu(+135 -0)📝
src/program/generate.cpp(+18 -0)📄 Description
Replaces #286, as you asked: whatever won goes into 0.1.31's tier, with no second tier. Stacked on #357 because it uses its
experts_unbuffered(). Please review only the last commit.What came over from #286
copy_blob), the decode misses (prefetch), the complement copy and the profile fill. Each batch has all its windows in flight at once, overlapped.cudaHostAlloccomplement is page-locked already. It only shrank because the mapped profile fill had taken the RAM first (16 GiB asked, 11.5-13.6 GiB held). With unbuffered reads it keeps all 16 GiB.stage_exchange/commit_exchangesalready swap without a file read.warms()returns false). ItsPrefetchVirtualMemoryof the mapping would read the experts through the file cache a second time. Here it had warmed only 8% of the file tier's decode reads.The choice is
experts_unbuffered(files, budget). It goes unbuffered whenever the files could not be kept beside the budget, cached now or not. A partly cached file's mapped pages still land in the working set: on an emulated 64 GB PC, with 14 of 16 probe reads cached, a mapped profile fill shrank the budget to 31 GiB and then ran the RAM out. A 64 GB PC with the same budget, the plain--mmap-expertsmode without a budget, and Linux keep the mapped path unchanged.STRATA_UNBUFFERED_LOAD=1/0forces the choice.NTFS and mapped files
NTFS runs a file's unbuffered reads one at a time while the file is mapped (or cached) anywhere, and the engine always maps the GGUF shards for the token embedding and PLE. Measured on this PCIe 5 drive, random reads, 6 threads x queue depth 48:
So windows less than 1 MiB apart are merged into requests of up to 32 MiB. That took the complement copy from 7.4 to 4.5 s. Scattered reads (profile fill, prompt, decode) stay at the one-at-a-time rate.
Measured
Setup, the same as in my #286 reply:
--vram-reserve-mib 16900.--resident-budget-gib 16, the GGUF in place.Start-up phases:
Update: a pack's experts.bin too (second commit). setup's low-RAM packs have an experts.bin, and 0.1.31's tier mapped it. Yesterday that ran the emulated 32 GB PC out of RAM, below 1 GB available. Now it is read unbuffered as well: one window per blob, merged where near.
Greedy tokens are identical unbuffered, through the cache and on 0.1.31, with either pack.
Most of the remaining gap to the old tier is the mapping effect above: the old tier read experts.bin, which nothing mapped. Two possible follow-ups:
Greedy tokens are identical unbuffered (forced on a 128 GB run), through the cache, and on 0.1.31.
🤖 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.