perf: streaming I/O overlap — preadv coalescing, Inkling shadow prefetch + pipelined prefill - #21
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bd63627b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
NeelM0906
added a commit
that referenced
this pull request
Aug 21, 2026
Codex review on #21: a throw mid-pipeline (failed prefetch pread, drain surfacing a GPU error) exited prefillInklingChunk with the pending command buffer still running against the persistent act/acc scratch, racing an immediate reset or retry. A scoped drain now waits it out on every exit path.
3 tasks
NeelM0906
added a commit
that referenced
this pull request
Aug 26, 2026
Codex review on #21: a throw mid-pipeline (failed prefetch pread, drain surfacing a GPU error) exited prefillInklingChunk with the pending command buffer still running against the persistent act/acc scratch, racing an immediate reset or retry. A scoped drain now waits it out on every exit path.
NeelM0906
force-pushed
the
claude/streaming-io-overlap
branch
from
August 26, 2026 17:36
6b950ba to
b965e04
Compare
Misses whose blobs are exactly contiguous on disk (uniform stride or a permuted expertOffsets table) are grouped into runs and fetched with one preadv per run — one syscall and one sequential NVMe read instead of a random pread per expert. Applies to both the cache-plan path and the speculative/async fill path. Roadmap Task 14e.
SpeculativeRouterInkling mirrors the DSV4 pilot: layer L+1's sigmoid router run against layer L's post-attention state inside layer L's own command buffer, read at the same router wake, feeding the existing reserve/read/join/confirm machinery and the shadow issue budget. Same kernels as the real router, so ranking is bit-identical (pinned by a parity test); a real-install test pins off-vs-shadow greedy identity. Mode stays opt-in (MFERENCE_SPEC_PREFETCH) until an A/B on the install accepts a default, matching how DSV4 earned its shadow default.
prefillInklingChunk's routed loop serialized fetch->encode->drain, so the SSD never overlapped GPU work (the deficiency documented in docs/INKLING_SMALL.md). Now expert e+1 is planned and preaded while expert e's GLU runs, with misses placed only in slots the in-flight command buffer does not touch; accumulation order is unchanged (serial queue + hazard tracking), so output stays byte-identical. Uses the same PrefillRoutedTileScheduler contract as the other families. MFERENCE_INKLING_PREFILL_PIPELINE=0 is the kill-switch.
Codex review on #21: a throw mid-pipeline (failed prefetch pread, drain surfacing a GPU error) exited prefillInklingChunk with the pending command buffer still running against the persistent act/acc scratch, racing an immediate reset or retry. A scoped drain now waits it out on every exit path.
NeelM0906
force-pushed
the
claude/streaming-io-overlap
branch
from
August 26, 2026 18:15
b965e04 to
91da507
Compare
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.
Phase B of the roadmap's Task 14 streaming workstream. Stacked on #20 (retarget to main once that merges).
Changes
Tests
TODO before defaulting Inkling shadow on
🤖 Generated with Claude Code