You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(server): tick-cooperative speculative decoding to remove the burst head-of-line block #734
#638 part 2 asked to replace the run-to-completion speculative burst (src/server/batch/speculative_burst.rs, dispatched from execute_prefill) with tick-cooperative slices so a speculative request no longer stalls every concurrent classic decode row for its whole duration (HOL block documented at src/server/model_worker.rs:400-438). PR #733 landed the measurement side (pairing matrix, adaptive-policy de-rate so GB10 declines regressing pairings, and a BurstFinalized.burst_wall_ms observability counter that measures the HOL stall) but deferred the slice itself.
MtpGenerator<T> borrows the model through its adapter, so the generator cannot be stashed across scheduler ticks (self-referential borrow); this is exactly why the burst runs to completion today. A resumable design needs a generator step API with stored per-round state (feasible: MtpVerifyOutput owns MLX handles, not model borrows) plus drafter re-seed on resume.
Design sketch (from #638's plan and #733's analysis)
One speculative round (draft K + verify) per scheduler tick, re-entering the tick loop between rounds (round_loop.rs / round_loop_batched.rs are already per-round structured); per-sequence KV slots preserve state across interleaved classic decodes; the cross-tick lookahead pipeline (#632) is already excluded under speculative dispatch (lookahead_params returns None), and any new action type must call discard_lookahead like the Prefill action does; preferred end state is speculative rounds as first-class decide_action outcomes.
Acceptance criteria
With one speculative and one classic request active, the classic request's inter-token latency stays bounded (scheduler-level regression test with a mock/small model, plus manual E2E via scripts/bench_serving_concurrency.py --concurrency 2).
burst_wall_ms drops to about one round length.
Speculative-vs-greedy output parity holds for B=1 and batched.
One more scope note from PR #733's review: the interim HOL observability landed as a tracing log line (BurstFinalized with burst_wall_ms / rounds / accepted / hol_waiters), not as BatchObservability counters surfaced through /metrics, and hol_waiters is a finalize-time snapshot rather than max concurrent waiters. When implementing the tick-cooperative slice here, promote these to proper BatchObservability fields (rounds executed, tokens accepted, HOL wait) per the original #638 AC.
Activity
inureyes commentedon Jul 10, 2026
One more scope note from PR #733's review: the interim HOL observability landed as a tracing log line (BurstFinalized with burst_wall_ms / rounds / accepted / hol_waiters), not as BatchObservability counters surfaced through /metrics, and hol_waiters is a finalize-time snapshot rather than max concurrent waiters. When implementing the tick-cooperative slice here, promote these to proper BatchObservability fields (rounds executed, tokens accepted, HOL wait) per the original #638 AC.
docs: cover speculative serving in CONTINUOUS_BATCHING and the CLI help
review: document the shipped tick-slice default, its HOL bound, and t…
fix(server): re-check the B=1 verdict and budget at slice grant promo…
perf(server): rotate the speculative slice slot across waiting reques…
perf(server): tick-cooperative speculative decoding to remove the bur…
fix(server): stop the mixed-step prototype from corrupting its own me…
fix(server): bound a parked chunked prefill's wait with a fairness grant
perf(server): tick-cooperative speculative decoding to remove the bur…
perf(server): rotate the speculative slice slot across waiting reques…