Skip to content

feat(models): run Inkling 2's bundled DSpark drafter - #3384

Merged
inureyes merged 2 commits into
mainfrom
feature/issue-3374-inkling2-dspark-drafter
Nov 24, 2026
Merged

inureyes merged 2 commits into
mainfrom
feature/issue-3374-inkling2-dspark-drafter

Conversation

@inureyes

Copy link
Copy Markdown
Member

Closes #3374

Runs the DSpark drafter that both Inkling 2 checkpoints bundle in mtp.safetensors, ported from mlx-vlm 466069f5. --draft-model (server --model-draft) names the target directory itself; the pairing is detected from mtp_config.

  • Drafter (mlxcel-core/src/drafter/inkling2_dspark/): upstream config validation, context-cached draft layers (sliding and global), the fuse_weight mix, and the rnn_hidden Markov head with its one-time f64 fold into the target LM head. Greedy only, verify width 2..=8.
  • Target (src/models/inkling2_speculative.rs): verify forward with upstream's pre-layer captures inside the speculative append scope, suppressed ids on every row, rollback through trim_caches, and the block-versus-chain exactness probe.
  • Wiring: offline DFlash arm (an image prompt prefills from merged embeddings), server burst at B = 1 with its own drafter family, width checks, and /v1/internal/mtp-policy, which now names a passing DFlash pairing with reason dflash_dispatch (documented; a declined pairing reports exactness_declined).

Validation (M3 Ultra, all GPU runs under the lock)

  • Exactness probe: declines at widths 8 and 2 (position 0 differs in 464983 of 800232 logit bytes at 8). The CLI refuses with a named error and the server serves classic decode unless MLXCEL_MTP_ALLOW_INEXACT=1.
  • With the override, ABAB 256-token greedy on Mini: 35.54 to 38.55 tok/s (acceptance 0.170, mean accepted 1.18) and 35.93 to 54.95 tok/s (0.307, 2.12). mlx-vlm: 33.9 to 42.2 and 33.1 to 65.9. Details in docs/benchmark_results/inkling2-mini-dspark-m3ultra-2026-11-24.md.
  • Drafter proposals equal mlx-vlm's token for token in every round whose context agrees; the runs separate at a near-tie target bonus. Text agreement with mlx-vlm's drafter run: 213 and 71 characters (mlx-vlm's own drafter run leaves its classic text after 213 and 214).
  • Image prompt with the drafter emits the same 48 tokens as classic decode. The 4-bit export (no sidecar) runs as before.
  • Server: one chat request ran as a DSpark burst (34 rounds, acceptance 0.272); mtp-policy reported the pairing.
  • Tests: inkling2_dspark (13, host f64 reference for mix, Markov step, fold and draft_block across rounds), inkling2::speculative (emitted tokens equal the verify argmax every round), inkling, drafter::, coverage, detection, dispatch, mtp_policy. Clippy, fmt and the contract scripts pass.

Deferred

@inureyes inureyes added status:review Under review type:enhancement New features, capabilities, or significant additions priority:medium Medium priority area:models Model architectures, weights, loading, metadata area:inference Generation, sampling, decoding (incl. speculative, DRY) modelsize:medium 4-bit checkpoint 10-50GB; comfortable on a 128GB dev box modeltype:vlm Vision-language model arch:hybrid Hybrid attention stack (linear/sliding/full or attention+SSM interleave) status:done Completed and removed status:review Under review labels Nov 24, 2026
inureyes added a commit that referenced this pull request Nov 24, 2026
Both Inkling 2 checkpoints ship a DSpark drafter in mtp.safetensors that mlxcel could not use. This ports mlx-vlm 466069f5's drafter (config validation, context-cached draft layers, the fuse-weight mix, the rnn_hidden Markov head with its one-time f64 fold into the LM head) as a DFlash-kind drafter, detected when --draft-model names an Inkling 2 directory with mtp_config and mtp.safetensors.

The target half adds a verify forward with upstream's pre-layer captures inside the speculative append scope, suppressed ids on every verify row, rollback through trim_caches, and the block-versus-chain exactness probe. It is wired into the offline DFlash arm (image prompts prefill from merged embeddings), the server burst (B = 1, its own drafter family), the verify-width checks, and /v1/internal/mtp-policy, which now names a DFlash pairing with reason dflash_dispatch.

On the M3 Ultra the probe declines at every width, so the drafter runs only with MLXCEL_MTP_ALLOW_INEXACT=1; there, 256-token greedy decode on Mini goes from 35.5 to 38.6 and 35.9 to 55.0 tok/s, and the proposals match mlx-vlm token for token where contexts agree. Small is deferred (download incomplete, #3373 open).

Closes #3374
@inureyes
inureyes force-pushed the feature/issue-3374-inkling2-dspark-drafter branch from 5120715 to e382dd1 Compare November 24, 2026 04:01
@inureyes
inureyes marked this pull request as ready for review November 24, 2026 04:03
@inureyes
inureyes merged commit 451ec68 into main Nov 24, 2026
32 of 33 checks passed
@inureyes
inureyes deleted the feature/issue-3374-inkling2-dspark-drafter branch November 24, 2026 04:03
@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

arch:hybrid Hybrid attention stack (linear/sliding/full or attention+SSM interleave) area:inference Generation, sampling, decoding (incl. speculative, DRY) area:models Model architectures, weights, loading, metadata modelsize:medium 4-bit checkpoint 10-50GB; comfortable on a 128GB dev box modeltype:vlm Vision-language model priority:medium Medium 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(speculative): Inkling 2 bundled DSpark drafter

1 participant