Repository navigation
update(inkling2): pick DSpark verify width by measured throughput - #3417
Merged
Merged
Conversation
Inkling 2 Small lost 10% on prose with DSpark: an 8-row verify round costs about 130 ms against a 52 ms decode step, and prose emits about 2.3 tokens per round. Because the Inkling 2 verify block equals decode at every width from 1 to 16, the round loop may now choose each round's width. - New `ExpectedThroughputWidth` policy (mlxcel-core `drafter::dflash::width_policy`): per-position acceptance estimates and per-width measured round cost pick the width with the most expected tokens per millisecond, down to classic decode, and re-try drafting after 8 classic steps. The first round at each width is not a cost sample (kernel compilation). Enabled only for targets that declare `exact_at_every_verify_width`; `MLXCEL_DFLASH_ADAPTIVE_WIDTH=0` keeps the fixed width. - Classic steps run pipelined like classic decode (`classic_steps`), and their hidden rows feed the next draft. - The grouped expert matvec now serves unlooped Small verify forwards too (8 rows: 129 ms against 150 ms, digests identical). - The server DFlash burst prefills Inkling 2 in the `--prefill-chunk-size` partition through `DFlashTargetModel::prefill_burst`. - Mini 4-bit per-row attention projections cost at most 4.1 ms per 8-row round; documented, no new kernel. Small, 256 greedy tokens, ABAB: prose 1.12x classic (was 0.90x), code 1.58x (was 1.54x), text byte-identical. Per-visit diagnostic on Small with the grouped kernel: 0 differing logits at widths 2, 4, 8 and after 1100 tokens. Numbers in docs/benchmark_results/inkling2-dspark-followups-m3ultra-2026-11-25.md. Closes #3410
…ling2-dspark-followups
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.
Inkling 2 Small lost 10% on prose with DSpark because an 8-row verify round costs about 130 ms against a 52 ms decode step. #3280 made the Inkling 2 verify block equal decode at every width from 1 to 16, so the round loop can now choose a width per round without changing the text.
Changes
mlxcel_core::drafter::dflash::width_policy). Each round takes the width with the most expected tokens per measured millisecond. Expected tokens come from per-position acceptance estimates and cost from per-width round times. Width 1 means classic decode, and drafting is re-tried after 8 classic steps. A width's first round is not used as a cost sample because it includes kernel compilation. The policy applies only to targets that return true fromSpeculativeTarget::exact_at_every_verify_width(Inkling 2 today).MLXCEL_DFLASH_ADAPTIVE_WIDTH=0keeps the fixed width.classic_steps.rs). Their hidden rows feed the next draft. The CLI DFlash line now reportsclassic_steps.--prefill-chunk-sizepartition (DFlashTargetModel::prefill_burstcallsInkling2Model::prefill_speculative_planned). The CLI still usesMLXCEL_PREFILL_CHUNK.Results (M3 Ultra, 256 greedy tokens,
--show-reasoning, ABAB)docs/benchmark_results/inkling2-dspark-followups-m3ultra-2026-11-25.md.Tests
models::inkling2::speculative::tests::round_tests::the_burst_prefill_follows_the_server_chunk_size: a 40-token prompt at chunk 16 produces the same bytes as the classic chunked prefill and differs from the old one-forward prefill.classic_steps_keep_the_text_and_feed_the_drafter_every_rowcovers classic steps.inklingselector (176),dflash,speculative_burst,coverage_tests, the mlxcel-coredrafter::dflashtests, clippy, fmt and the contract scripts.Closes #3410