Skip to content

Add MTP anchored ngram speculation - #887

Closed
i386 wants to merge 4 commits into
mainfrom
jd/jianyang-mtp-ngram
Closed

Add MTP anchored ngram speculation#887
i386 wants to merge 4 commits into
mainfrom
jd/jianyang-mtp-ngram

Conversation

@i386

@i386 i386 commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a clean Skippy protocol break for mandatory client-open stage streams and implements server-native n-gram speculative proposals on the embedded stage-0 OpenAI path. The new path can use GLM native MTP as the first-token anchor and n-gram matching as a cheap span extender before distributed batched verification.

This PR is based on current main from a clean worktree. It does not include the discarded SPD/shard sidecar work.

What changed

  • Replaces the old server-ready/client-ready compatibility handshake with mandatory SOPN client-open framing and bumps the stage state version to 7.
  • Threads --openai-ngram-speculative, --openai-ngram-size, and --openai-ngram-min-match through serve-binary, embedded OpenAI args, and host-runtime Skippy resolution.
  • Adds the native native-mtp+ngram proposal path and telemetry labels for proposal source and MTP anchor verification.
  • Updates skippy-bench, skippy-correctness, and skippy-prompt callers to use the new stage-open protocol.
  • Adds a distributed skippy-bench run --driver open-ai-chat path that starts stage0 embedded OpenAI serving and drives /v1/chat/completions, so MTP+n-gram can be measured against the Improve GLM MTP parity and batched verify sampling #858 rows.
  • Adds explicit benchmark flags for native MTP sideband and OpenAI speculation controls instead of relying on ad hoc shell env.

Validation

Clean-main branch validation:

  • cargo fmt --all --check
  • cargo test -p skippy-protocol --lib
  • cargo test -p skippy-server --lib
  • cargo test -p skippy-bench
  • cargo test -p skippy-correctness
  • cargo test -p skippy-prompt
  • cargo test -p mesh-llm-host-runtime --lib inference::skippy
  • cargo clippy -p skippy-protocol --all-targets -- -D warnings
  • cargo clippy -p skippy-server --all-targets -- -D warnings
  • cargo clippy -p skippy-bench --all-targets -- -D warnings
  • cargo clippy -p skippy-correctness --all-targets -- -D warnings
  • cargo clippy -p skippy-prompt --all-targets -- -D warnings
  • cargo clippy -p mesh-llm-host-runtime --all-targets -- -D warnings
  • cargo clippy -p mesh-llm --all-targets -- -D warnings
  • cargo check -p mesh-llm

Benchmark path

The new benchmark row for this PR should be run with:

skippy-bench run \
  --driver open-ai-chat \
  --stage-native-mtp \
  --openai-speculative-window <N> \
  --openai-ngram-speculative \
  ...

Run it against the same GLM 4.7 MTP split/model/prompt corpus used for #858. Generated-token tok/s in driver-result.json is the hard metric; acceptance remains diagnostic telemetry.

Notes

This PR intentionally breaks Skippy wire compatibility and removes the old optional compatibility path. Lab tok/s results still need to be collected on this branch before moving the PR out of draft.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6302844e-e1f7-44a9-bcdd-a5a3d8c118a9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jd/jianyang-mtp-ngram

Comment @coderabbitai help to get the list of available commands and usage tips.

@i386
i386 force-pushed the jd/jianyang-mtp-ngram branch from 5513c2a to a413233 Compare June 21, 2026 04:24
michaelneale added a commit that referenced this pull request Jul 22, 2026
Capture the draft-model speculative-decode pipelining findings for branch
wip/wan-direct-prediction-return so the work can be picked up: what is proven
over WAN, the draft-vs-ngram acceptance-survival result, a Cohere/SWA trim
limitation, the 2-node bringup config trap, and pointers to the related
ngram-widening PRs (#1037, #1026, #875, #887).

Assisted-by: goose
@ndizazzo ndizazzo closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants