Repository navigation
Conversation
Owner
|
Nice and small. Please (1) refuse |
…rompt/token path)
…mlock succeeded else 'loaded (not locked)', neutral comments + --help (review)
q8atnight
force-pushed
the
pr/ple-io-ram
branch
from
September 30, 2026 10:25
2734b0f to
6499768
Compare
Contributor
Author
|
All three done and pushed (rebased on 0.1.28, builds clean):
Also: |
Owner
|
Released in 0.1.29: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A third
--ple-iomode:ram= themmapmapping with the whole tablemlocked at open, so no SSD read eversits on the prompt or token path.
madvise(MADV_WILLNEED)first, thenmlock; a start log line reports the timeit took. One commit on top of 0.1.27 (a790805).
directstays the default andmmapis unchanged; the ngramfiles are untouched upstream, so the change is the
PleIoOptions::lockflag, itsopen()handling, and theoption plumbing.
Measured
On 2x RTX 3090, IQ3_S, 121 GB RAM: stock
--ple-io directreads the 28.8 GB table with O_DIRECT, and a cold 32Kprompt waited ~3 s on those reads. With
ramthe table is mapped and locked once at start, and no table readtouches the SSD again. In use on our box since 2026-09-28 with no issue.
Cost and failure mode
ramcosts host RAM = the table size (28.8 GB here; our IQ3_S dual setup uses ~82 of 121 GB). Ifmlockisrefused —
ulimit -ltoo low, Docker's default memlock is 64 KB — the engine does NOT fail: it printsstrata: PLE table mlock failed (...): touching its pages insteadand touches every page, so the table stillenters the page cache but the kernel may evict it under memory pressure. For the lock itself to hold, start with
ulimit -l unlimited(Docker:--ulimit memlock=-1). The log linestrata generate: PLE table locked in RAM (--ple-io ram) in X sdistinguishes the two outcomes.Switch
--ple-io ramis opt-in;direct(andmmap) behave exactly as before.