Repository navigation
Add batched DFlash v1 decoding with live request membership - #121
Open
ronaldmannak wants to merge 4 commits into
Open
ronaldmannak wants to merge 4 commits into
ronaldmannak wants to merge 4 commits into
Conversation
Verify blocks at independent request positions, retain per-request sampling and recurrent state across admission or cancellation, and capture target/drafter prefixes only at retained delivery boundaries.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 650158d72b
ℹ️ 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".
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.
Batched DFlash decoding on Pico integration
Add an opt-in
BatchedDFlashTokenIteratorfor text requests using a dense, single-device Qwen3.5 target and a trained DFlash v1 drafter. One verification pass advances multiple requests. Each request keeps its own accepted prefix, sampler, generation limit, and recurrent state. Callers can admit or cancel requests between blocks using stable IDs.For prompt reuse, a snapshot carries the target cache, projected draft context, and exact token history. A caller that retained only part of a returned block gets a cache miss. Admission currently prefills the arriving request synchronously. The batch uses full-precision, unbounded KV caches. PicoCore serving policy is a separate integration step.
The first commit ports the DFlash loader, verifier, and reference tests from #70 and #71 to
pico/integration. It preserves the fork's native MTP and tensor-parallel paths. The batched implementation is a sibling of the existing ordinary iterator.Verification
Local Release benchmark on an Apple M5 Max, 40 GPU cores and 128 GB. Both the target and drafter were resident in both arms. Rates are median aggregate output tokens per second over three interleaved runs, including admission and final synchronization.
For the fixed batch the p95 inter-token gap rose from 19.6 to 29.0 ms. The staggered workload cancels at a token-progress threshold. That request produced 16 tokens under ordinary batching and 21 under DFlash. The other three requests each completed all 64 tokens. Both arms reproduced their token streams on all measured repeats.
The full local MLXLMTests run at
5107ce2recorded 3,128 passes, 10 skips, one existing expected failure (MiniCPM5 tool parsing), and zero unexpected failures. The pinned pre-commit formatter passed. Both the iterator and public token stream now reject unsupported token log probabilities before prefill. Regression tests passed for zero and three requested alternatives. GitHub skipped its hosted jobs under the fork’s upstream-only workflow guards.AI usage
OpenAI Codex adapted the existing DFlash port, implemented and reviewed the batched path, and ran the local validation.