docs(pod5): record that MADV_WILLNEED does not help the cold read - #220
Open
jayhesselberth wants to merge 1 commit into
Open
jayhesselberth wants to merge 1 commit into
jayhesselberth wants to merge 1 commit into
Conversation
jayhesselberth
force-pushed
the
worktree-pod5-prefetch
branch
from
August 15, 2026 19:41
068e855 to
b15c472
Compare
`MADV_SEQUENTIAL` only widens the readahead window; the leading edge stays a synchronous fault, which is what a cold `demux basecall` stalls on — the encoder sits idle 52-66% of samples waiting 88-152 s on the reader. Adding `MADV_WILLNEED` over the whole signal table is the obvious next step, so this records that it was tried and measured rather than leaving the next person to rediscover it. Both arms came from one binary (env-gated) to keep a build difference out of it. Cold 2x2 over two gpu nodes, each run reading a file that node had never touched, throughput normalised by file size: | node | prefetch off | prefetch on | | |---|---|---|---| | compgpu03 | 76.2 MiB/s | 76.1 MiB/s | -0.1% | | compgpu01 | 40.5 MiB/s | 45.0 MiB/s | +11% | | compgpu01 | 53.9 MiB/s | 35.7 MiB/s | -34% | On compgpu03 it is exactly neutral, and for a good reason: there the reader is already ahead (it waits 49-60 s on the encoder), so no I/O change can help. On compgpu01 the two replicate pairs disagree in direction against a same-setting spread of 40.5-53.9 MiB/s. The dominant variable is the node, not the advice — compgpu01 ran at half compgpu03's throughput for identical work at every setting. The tightness of the compgpu03 pair (76.1 vs 76.2) says the harness resolves small effects fine; the noise is real filesystem behaviour. No functional change; the experimental knob is not kept.
jayhesselberth
force-pushed
the
worktree-pod5-prefetch
branch
from
August 16, 2026 11:26
b15c472 to
13b9dc5
Compare
This branch has not been deployed
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.
Stacked on #219 (which is stacked on #218). Comment-only — no functional change, and the experimental knob is not kept.
Why this was worth trying
MADV_SEQUENTIALis already applied at mmap time, and its comment describes exactly the failure mode we measured. But it only widens the readahead window — the leading edge is still a synchronous fault, which is what a colddemux basecallstalls on: the encoder sits idle 52–66% of samples waiting 88–152 s on the reader.MADV_WILLNEEDis qualitatively different — it queues the I/O and returns, so pages can be resident before they are touched.It does not help.
Measurement
Both arms came from one binary (env-gated) so no build difference could leak in. Cold 2x2 over two gpu nodes, each run reading a file that node had never touched (page cache is per node), throughput normalised by file size since the files differ in size by up to 1.7x:
On compgpu03 it is exactly neutral, and for a good reason — there the reader is already ahead of the encoder (it waits 49–60 s on it), so the run is encoder-bound and no I/O change can help. On compgpu01 the two replicate pairs disagree in direction, against a same-setting run-to-run spread of 40.5–53.9 MiB/s.
Had I stopped at the first pair I would have shipped a "+11%" that the second pair contradicts.
What actually dominates
The node, not the advice. compgpu01 ran at roughly half compgpu03's throughput for identical work at every setting — the same 2.2x node spread that showed up in #219's depth sweep. The tightness of the compgpu03 pair (76.1 vs 76.2 MiB/s) says the harness resolves small effects fine; the noise is real filesystem behaviour on that node.
So for cold runs, the lever is which node the job lands on, not more code in the reader. Worth knowing before anyone spends more time optimising this read path.
161 pod5 tests pass; clippy and fmt clean.