mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #317] [CLOSED] ple: keep the SSD awake while rows are read (STRATA_SSD_KEEPALIVE) #2570
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#2570
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/317
Author: @BlueKingMuch
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:ssd-keepalive📝 Commits (1)
3653fafple: keep the SSD awake while rows are read (STRATA_SSD_KEEPALIVE)📊 Changes
6 files changed (+186 additions, -10 deletions)
View changed files
📝
include/strata/kernels/ngram.hpp(+5 -0)📝
include/strata/ngram/ple_reader.hpp(+13 -1)📝
src/kernels/ngram.cpp(+7 -3)📝
src/ngram/ple_reader.cpp(+92 -6)📝
src/ngram/ple_reader_test.cpp(+52 -0)📝
src/program/generate.cpp(+17 -0)📄 Description
Some SSDs drop into a power state after ~250 ms without a command and stall the next reads by 50-150 ms. Here that is a WD_BLACK SN7100 on Windows 11; the NVMe idle timeouts of Windows' power plan do not change it. In decode it hits the first PLE read after a pause: at the start of a request, or after a few rounds whose rows all came from the row cache.
--ple-io ram, which avoids the reads altogether, is not available on Windows.What changes
ple ioline adds "SSD kept awake by N reads (slowest X ms)".STRATA_SSD_KEEPALIVE=0turns it off,=50shortens the period;STRATA_SSD_KEEPALIVE_WINDOWsets the window in seconds. Only with the I/O worker (the default), not with--ple-sync-submitor--ple-io mmap/ram.snapshot()), since the worker may be counting a keep-alive read.The tokens do not change: requests without anything timing-dependent give the same 256 tokens with and without it, greedy and sampled.
Measured
RTX 4080 SUPER 32 GB, Ryzen 7 5800X3D, 64 GB DDR4, WD_BLACK SN7100, Windows 11; IQ3_S,
--max-context 262144. A local test build of 0.1.30 (30ec18e) with this commit and a few other PRs; the comparison is within that build (STRATA_SSD_KEEPALIVE=0against the default). The PLE numbers come from per-request read statistics that build logs (rows, SSD reads, slowest read, time decode waited for rows).Across the 132 measured requests of the eleven other engine variants in the same session, all with the keep-alive on, none had a PLE read over 10 ms.
A scan of the table without the engine, reading it the way the engine does after pauses of every length, gave these stall counts: 0 of 211 bursts after pauses under 200 ms, 35 of 73 after pauses of 200 ms and more, and 0 of 68 of those with the keep-alive on.
The cost is one 4 KiB read per 100 ms of otherwise idle SSD time, and only within 60 s of a request. It is on by default for that reason; if you prefer it opt-in, that is the default in one
getenvline. It touches the same reader as #291 (the FP8 table); the two should combine without trouble, since the keep-alive reads are raw page reads.Claude-Session: https://claude.ai/code/session_01FKZxC8sUotEzdWXws2FTUC
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.