mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2073] [CLOSED] PLE: --ple-io direct stays direct when the start-up probe measures the disk slow (STRATA_PLE_AUTO_MMAP=1 opts into the mmap switch); PLE read diagnostics #3842
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#3842
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/2073
Author: @imanu86
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/ple-direct📝 Commits (1)
779c858PLE: --ple-io direct stays direct when the start-up probe measures the disk slow (STRATA_PLE_AUTO_MMAP=1 restores the switch to mmap); PLE read diagnostics for prefill and decode📊 Changes
7 files changed (+49 additions, -6 deletions)
View changed files
📝
include/strata/core/verify.hpp(+2 -0)📝
include/strata/ngram/ple_reader.hpp(+2 -0)📝
src/core/verify.cpp(+4 -0)📝
src/kernels/ngram.cpp(+5 -1)📝
src/ngram/ple_reader.cpp(+2 -0)📝
src/prefill/prefill.cpp(+6 -1)📝
src/program/generate.cpp(+28 -4)📄 Description
Title
Issue: none (a start-up default that misfired on a slow SSD, and read diagnostics).
Summary
Since 0.1.42 the engine probes the PLE table at start-up and, under 15,000 rows/s, switches
--ple-io directtommapon its own. The probe reads 64 rows a batch from a cold table, a far lower queue depth than a prompt chunk'sbatched read, so a healthy SATA SSD can measure "slow" and the switch costs a long prompt more than three times its
time. This change keeps the probe and its warning but makes the switch opt-in (
STRATA_PLE_AUTO_MMAP=1); anexplicit
--ple-iois untouched. It also adds a few PLE read diagnostics.Why
Measured on one PC (PLE table on a SATA SSD, 131K-token prompt, two-card layer split): the probe read 1,259 rows/s,
switched to mmap, and the prompt took 260 s; the same engine with direct I/O took 75 s and decode was 3.9%
faster (the mmap mode also drops the row cache and the in-flight reads). mmap faults the rows in one 4 KiB page at a
time; direct I/O keeps
--ple-inflightreads in flight and the chunk read-ahead hides them. The probe's figure is acold, low-depth read and does not predict the prompt path's throughput.
What changed
src/program/generate.cpp: the probe still runs and printsPLE direct read probe: N rows/s; under the threshold itwarns and keeps direct unless
STRATA_PLE_AUTO_MMAP=1(then it switches as before). WithSTRATA_DECODE_TIMINGthe decode summary adds the primary verifier's PLE gather time per window and the reader'scumulative counters before and after the request (
strata decode PLE primary/before/after).src/ngram/ple_reader.cpp,include/strata/ngram/ple_reader.hpp:ple io:adds the read mean, the maximum and thecount of reads over 100 ms (all reads, where p50/p99 cover the last 65,536).
src/prefill/prefill.cpp: a chunk that waited more than 1 s for its PLE rows logs one line(
strata prefill: the chunk at token N waited X ms for its PLE rows).src/kernels/ngram.cpp,include/strata/core/verify.hpp: the gather time counter.No kernel changes; the output tokens are the same in both I/O modes.
Measurements
RTX 2080 Ti 22 GB + RTX 3060 12 GB, Windows 11, CUDA 12.6,
--layer-split 16 --pipeline-windows 2, Qwen3.8-Flash-NextIQ3_XXS, 131K-token prompt, PLE table on a SATA SSD (cold):
With the table on an NVMe the probe says
fine(91,220 rows/s here) and nothing changes.Built and started on v0.1.43 (
7695859a, RTX 2080 Ti + RTX 3060 layer split, Windows): the probe reports43,290 rows/s (fine)on the NVMe, the engine serves as before; the same code has run in this fork's daily build since 0.1.42.Risks / limits
A disk that really is too slow for direct I/O keeps direct unless
STRATA_PLE_AUTO_MMAP=1is set; the warning saysso and names the variable.
--ple-io ramand an explicit--ple-io mmapbehave as before.Part of a series from a public patch registry (
stack/in the fork imanu86/Strata-2080Ti): one lever per PR, eachopt-in or bit-exact, measured on the same two-card box.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.