Skip to content

feat: enable prompt lookup verify rounds on first-generation Inkling - #3423

Merged
inureyes merged 2 commits into
mainfrom
feature/issue-3422-inkling-prompt-lookup
Nov 25, 2026
Merged

inureyes merged 2 commits into
mainfrom
feature/issue-3422-inkling-prompt-lookup

Conversation

@inureyes

Copy link
Copy Markdown
Member

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.

  • A token-only speculative append of 2 to 16 rows enters the MTP verify scope in forward_with_sequence_id, so it is row-invariant and records each convolution's input window in block_tails.
  • supports_speculative_verify_rewind returns the row-kernel setting (MLXCEL_INKLING_ROW_INVARIANT, on by default). With it off the gate still refuses.
  • rewind_decode_appends goes through the new inkling_layer::drop_newest_verify_rows. It derives the block length from the windows (window rows minus state rows), accepts kept == 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, or n past the block are all refused.
  • A speculative append wider than 16 rows also records its windows, so --prompt-lookup-max-draft above 15 still rewinds. Those rows are not byte-identical to the chain.
  • supports_padded_prefill stays false, and trim_state behavior 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.
  • The Inkling VL wrapper delegates both hooks. The survey's engine probe now runs on this family; Inkling 2 is still excluded, so its verdicts do not change.
  • Docs: the Inkling row in docs/supported-models.md, a paragraph in docs/speculative-acceptance.md, and the MLXCEL_INKLING_ROW_INVARIANT entry.

Results (M3 Ultra)

  • survey_block_vs_chain, engine path: equal in every cell. That is widths 2/4/8 × prompts 8/600/2100 on inkling-0.6b-a0.6b, and widths 2/4/8/16 on inkling-small-mlx-4bit. Before this change the engine path reported NotRun.
  • --prompt-lookup text at temperature 0 equals classic decode on every run on both checkpoints (copy, prose and repeat prompts).
  • ABAB, 4 cycles, on copy-heavy replies. Inkling-Small: 42.12 tok/s classic against 48.00 with prompt lookup (1.14x, 2.26 tokens per forward). 0.6B: 235.52 against 500.41 (2.12x). On replies that give it nothing to draft, prompt lookup runs at 0.81x (0.6B) and 0.87x (Small, one run). Full tables are in docs/benchmark_results/inkling-prompt-lookup-m3ultra-2026-11-25.md.

Test plan

  • models::inkling and inkling lib tests under the GPU lock (182 passed; models::inkling rerun after the gate test was shortened, 86 passed). These include the new gate test in tiny_tests.rs, and prompt_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_tests and prompt_lookup filters.
  • fmt, both clippy invocations, the used-by, kernel-dtype, env-var, crate-version, kernel-port, binary-asset and license checks.
  • The broad cargo test --release --lib inkling gate is left to the orchestrator. The server path shares Engine::verify_rounds_unsupported and verify_round with the CLI but was not exercised end to end.

Closes #3422

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
@inureyes inureyes added status:review Under review type:enhancement New features, capabilities, or significant additions priority:low Low priority area:models Model architectures, weights, loading, metadata area:inference Generation, sampling, decoding (incl. speculative, DRY) platform:macos macOS (Apple Silicon) specific labels Nov 25, 2026
@inureyes inureyes added status:done Completed and removed status:review Under review labels Nov 25, 2026
@inureyes
inureyes marked this pull request as ready for review November 25, 2026 03:22
@inureyes
inureyes merged commit a49a4bc into main Nov 25, 2026
33 checks passed
@inureyes
inureyes deleted the feature/issue-3422-inkling-prompt-lookup branch November 25, 2026 03:23
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:inference Generation, sampling, decoding (incl. speculative, DRY) area:models Model architectures, weights, loading, metadata platform:macos macOS (Apple Silicon) specific priority:low Low priority status:done Completed type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Enable prompt lookup verify rounds on first-generation Inkling

1 participant