[PR #1325] file tier (Windows): read each expert from experts.bin and a mirror on a second drive at once #3384

Open
opened 2026-11-07 14:41:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1325
Author: @malloc32
Created: 10/7/2026
Status: 🔄 Open

Base: main ← Head: pr/experts-mirror


📝 Commits (5)

  • d3659bc prefill: batched unbuffered expert reads in the stager; close the experts.bin view once reads are unbuffered
  • f577faa file tier: STRATA_DIRECT_SPLIT_KIB reads a large unbuffered request as several slices in flight together (Windows, experiment)
  • b39f4dd file tier: STRATA_EXPERTS_MIRROR spreads each unbuffered read over experts.bin and a copy on another drive (Windows, experiment)
  • 40d3425 file tier: the experts.bin mirror is checked against 16 sampled 64 KiB blocks before it is used
  • 300de9f bench: reading each expert from two drives at once on Windows, measured (990 PRO + EXCERIA PRO)

📊 Changes

5 files changed (+287 additions, -32 deletions)

View changed files

➕ bench/results/2026-10-07-windows-experts-mirror/README.md (+50 -0)
📝 include/strata/core/expert_source.hpp (+18 -0)
📝 src/core/expert_source.cpp (+168 -14)
📝 src/prefill/prefill.cpp (+43 -18)
📝 src/program/generate.cpp (+8 -0)

📄 Description

AI-written. This PR was prepared by an AI (Claude Opus 5.5, via Claude Code) at the submitter's request; the code and the measurements (including the read-latency micro-benchmark) were done by the AI on the submitter's machine. The idea of using both drives came from the submitter, who reviewed it before opening.

Depends on #1323 (the #833 port is this branch's first commit); review that one first.

Update 2026-10-07: rebased onto 0.1.40.2 (e8ca9af) together with #1323; no conflicts in this branch's own commits. The mirror has been in daily use here since (checked again after a reboot).

What

  • STRATA_EXPERTS_MIRROR=<path>: a byte-identical copy of experts.bin on another drive. Each unbuffered request is read as two halves, one per drive, in flight together. Before use, the copy's size and 16 sampled 64 KiB blocks (first and last included) are compared with the original; a stale copy is refused and the reads stay on one drive.
  • STRATA_DIRECT_SPLIT_KIB=K: a request larger than K KiB is read as K-KiB slices issued together (alternating drives with a mirror).

Windows only, experts.bin only. Without the variables nothing changes.

Measured

Details in bench/results/2026-10-07-windows-experts-mirror/.

  • One ~2 MB expert, unbuffered: 482 us from one drive (Samsung 990 PRO); 288 us with its two halves read from the 990 PRO and a KIOXIA EXCERIA PRO at once.
  • With a RAM budget and unbuffered reads (IQ3_S, 2x RTX 5060 Ti): decode 53.7 +- 0.8 -> 58.4 tok/s (+8.7%) with mirror + 512 KiB slices; prompts +3-5%.

Cost: a second copy of experts.bin (50 GB here), which has to be copied again whenever the pack changes.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1325 **Author:** [@malloc32](https://github.com/malloc32) **Created:** 10/7/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/experts-mirror` --- ### 📝 Commits (5) - [`d3659bc`](https://github.com/Niko1221/Strata/commit/d3659bc752b101d422090fed7d6c24f19e0ebc11) prefill: batched unbuffered expert reads in the stager; close the experts.bin view once reads are unbuffered - [`f577faa`](https://github.com/Niko1221/Strata/commit/f577faa20ba7a03b00430adc3f18cfd1aa752cd2) file tier: STRATA_DIRECT_SPLIT_KIB reads a large unbuffered request as several slices in flight together (Windows, experiment) - [`b39f4dd`](https://github.com/Niko1221/Strata/commit/b39f4dde3fa7e564cd6adb4912a8fe696f06e705) file tier: STRATA_EXPERTS_MIRROR spreads each unbuffered read over experts.bin and a copy on another drive (Windows, experiment) - [`40d3425`](https://github.com/Niko1221/Strata/commit/40d3425dfe90ec362cba4fb93b2471872ca33b94) file tier: the experts.bin mirror is checked against 16 sampled 64 KiB blocks before it is used - [`300de9f`](https://github.com/Niko1221/Strata/commit/300de9fce297f604b63ace4f6a5bae10ee641263) bench: reading each expert from two drives at once on Windows, measured (990 PRO + EXCERIA PRO) ### 📊 Changes **5 files changed** (+287 additions, -32 deletions) <details> <summary>View changed files</summary> ➕ `bench/results/2026-10-07-windows-experts-mirror/README.md` (+50 -0) 📝 `include/strata/core/expert_source.hpp` (+18 -0) 📝 `src/core/expert_source.cpp` (+168 -14) 📝 `src/prefill/prefill.cpp` (+43 -18) 📝 `src/program/generate.cpp` (+8 -0) </details> ### 📄 Description **AI-written.** This PR was prepared by an AI (Claude Opus 5.5, via Claude Code) at the submitter's request; the code and the measurements (including the read-latency micro-benchmark) were done by the AI on the submitter's machine. The idea of using both drives came from the submitter, who reviewed it before opening. **Depends on #1323** (the #833 port is this branch's first commit); review that one first. **Update 2026-10-07:** rebased onto 0.1.40.2 (`e8ca9af`) together with #1323; no conflicts in this branch's own commits. The mirror has been in daily use here since (checked again after a reboot). ## What - `STRATA_EXPERTS_MIRROR=<path>`: a byte-identical copy of `experts.bin` on another drive. Each unbuffered request is read as two halves, one per drive, in flight together. Before use, the copy's size and 16 sampled 64 KiB blocks (first and last included) are compared with the original; a stale copy is refused and the reads stay on one drive. - `STRATA_DIRECT_SPLIT_KIB=K`: a request larger than K KiB is read as K-KiB slices issued together (alternating drives with a mirror). Windows only, `experts.bin` only. Without the variables nothing changes. ## Measured Details in `bench/results/2026-10-07-windows-experts-mirror/`. - One ~2 MB expert, unbuffered: 482 us from one drive (Samsung 990 PRO); 288 us with its two halves read from the 990 PRO and a KIOXIA EXCERIA PRO at once. - With a RAM budget and unbuffered reads (IQ3_S, 2x RTX 5060 Ti): decode **53.7 +- 0.8 -> 58.4 tok/s** (+8.7%) with mirror + 512 KiB slices; prompts +3-5%. Cost: a second copy of `experts.bin` (50 GB here), which has to be copied again whenever the pack changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3384
No description provided.