Repository navigation
feat: enable prompt lookup verify rounds on first-generation Inkling - #3423
Merged
Merged
Conversation
Prompt lookup and the server's token-only verify rounds refused first-generation Inkling: its state is model-owned and the model did not rewind it. PR #3419 already had the exact rewind for MTP (convolution input windows recorded inside the verify scope, `keep_verified_prefix`); this wires it to the token-only round. - `forward_with_sequence_id` enters the verify scope for a speculative append of 2 to 16 rows, so the block is row-invariant and records its windows. - `supports_speculative_verify_rewind` follows the row kernel (`MLXCEL_INKLING_ROW_INVARIANT`); `rewind_decode_appends` drops the newest rows through the new `drop_newest_verify_rows`, which derives the block length from the windows, accepts a full reject, and validates every layer before mutating. Wider speculative appends also record windows, so they rewind (not byte-exact). - The Inkling VL wrapper delegates both hooks; the survey's engine probe now runs on the family. - `trim_state`'s comment and line 66 of the #3419 reports no longer call it the prompt-lookup rewind. Validation: Inkling unit tests (new gate test, byte-exact rewind at every reject position for widths 4 and 10), coverage tests, `survey_block_vs_chain` engine rows equal on both checkpoints, `--prompt-lookup` text equal to classic, ABAB in docs/benchmark_results/inkling-prompt-lookup-m3ultra-2026-11-25.md. Closes #3422
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
First-generation Inkling now takes prompt-lookup verify rounds (
mlxcel generate --prompt-lookup, the server's--draft-kind prompt-lookup, and the full-model drafter), reusing the exact rewind PR #3419 built for MTP.forward_with_sequence_id, so it is row-invariant and records each convolution's input window inblock_tails.supports_speculative_verify_rewindreturns the row-kernel setting (MLXCEL_INKLING_ROW_INVARIANT, on by default). With it off the gate still refuses.rewind_decode_appendsgoes through the newinkling_layer::drop_newest_verify_rows. It derives the block length from the windows (window rows minus state rows), acceptskept == 0(a failed round, or the width warm-up), and checks every layer before it changes any. A layer with no windows, layers that disagree, ornpast the block are all refused.--prompt-lookup-max-draftabove 15 still rewinds. Those rows are not byte-identical to the chain.supports_padded_prefillstaysfalse, andtrim_statebehavior is unchanged. Its comment and line 66 of the update(inkling): make Inkling-Small MTP exact at every width #3419 reports (en, ko) now say it serves padded prefill only.docs/supported-models.md, a paragraph indocs/speculative-acceptance.md, and theMLXCEL_INKLING_ROW_INVARIANTentry.Results (M3 Ultra)
survey_block_vs_chain, engine path: equal in every cell. That is widths 2/4/8 × prompts 8/600/2100 oninkling-0.6b-a0.6b, and widths 2/4/8/16 oninkling-small-mlx-4bit. Before this change the engine path reportedNotRun.--prompt-lookuptext at temperature 0 equals classic decode on every run on both checkpoints (copy, prose and repeat prompts).docs/benchmark_results/inkling-prompt-lookup-m3ultra-2026-11-25.md.Test plan
models::inklingandinklinglib tests under the GPU lock (182 passed;models::inklingrerun after the gate test was shortened, 86 passed). These include the new gate test intiny_tests.rs, andprompt_lookup_tests.rs: byte equality against the single-token chain after a rewind at every reject position for widths 4 and 10 (full reject included), refusal without mutation, and a width-20 tolerance check.--lib coverage_testsandprompt_lookupfilters.cargo test --release --lib inklinggate is left to the orchestrator. The server path sharesEngine::verify_rounds_unsupportedandverify_roundwith the CLI but was not exercised end to end.Closes #3422