Skip to content

feat(glm52): add checkpoint-native MTP speculative decoding#762

Merged
xiaguan merged 10 commits into
mainfrom
feat/glm52-native-mtp-forward
Jul 26, 2026
Merged

feat(glm52): add checkpoint-native MTP speculative decoding#762
xiaguan merged 10 commits into
mainfrom
feat/glm52-native-mtp-forward

Conversation

@xiaguan

@xiaguan xiaguan commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Add checkpoint-native GLM5.2 MTP speculative decoding with a separate layer-78 KV lane, proposal/recycle execution, scheduler-wide collectives, and an official-vLLM oracle harness.

The integration also:

  • feeds final-normalized target hidden states into MTP, matching the official vLLM model boundary;
  • represents drafter selection and MTP rounds as enums so invalid combinations are unrepresentable;
  • bumps the rank-host wire protocol and covers the drafter payload with a round-trip test;
  • drains every rank response before returning collective errors, preserving the root cause;
  • corrects the shared EP8 routed-expert order used by every GLM5.2 target MoE layer: quantize the unweighted SwiGLU activation before W2, apply route weights after W2, then apply routed scaling before adding the unscaled shared expert;
  • includes official-vLLM front and layer-78 fixtures plus a full production-path slot-reuse gate;
  • integrates the native-MTP lane with the latest TP4 prefill-only build and scheduler contracts.

Accuracy

  • Official-vLLM MTP fixture: MLP RMS 8.62e-3, chained hidden RMS 1.87e-2, exact top-1, top-8 overlap 8/8, and top-32 overlap 30/32.
  • Matched c8 mean accepted length: OpenInfer 1.753 before the hidden-boundary fix, 3.725 after it, versus official vLLM 3.786.
  • The selected 251-token target trajectory improves from 1.000 to 5.795 mean accepted length; the first draft matches token 98825.
  • Post-change GSM8K: plain target 195/200, native MTP 196/200. There is no identical pre-change plain-task A/B, so this is a regression check rather than a task-accuracy improvement claim.
  • The latest-main 8×H200 production gate passes in 234.13 s, including a released-slot reuse request, at least 32 reuse verification rounds, and eight mixed-length rank-pinned requests.
  • The layer-6 EP8 oracle passes all g64/g32/g16/g8 groupings with 62/64 probes inside tolerance per grouping and two permitted near-tie outliers.

Performance

All comparisons below use the same 8×H200 node, checkpoint, greedy sampling, fixed output length, disabled prefix cache, and matched request corpus.

Engine Concurrency TPOT Mean accepted length TPOT × accepted length
OpenInfer native MTP 1 7.749 ms 3.8762 30.04 ms
official vLLM native MTP 1 8.814 ms 3.4858 30.72 ms
OpenInfer before boundary fix 8 23.44 ms 1.753 41.10 ms
OpenInfer after boundary fix 8 11.31 ms 3.725 42.11 ms
official vLLM native MTP 8 16.90 ms 3.786 63.98 ms

The repeated c1 result shows no remaining decode TPOT deficit: OpenInfer is 1.065 ms lower, while proxy round cost differs by 0.69 ms. OpenInfer TTFT is higher (432.50 ms versus 232.57 ms), so this is a decode result, not a broad end-to-end latency win. The c8 engines use different target topologies and generation trajectories; accepted length is reported as serving evidence, not isolated MTP-forward parity.

Validation

  • cargo fmt --all -- --check
  • cargo check --release -p openinfer-server --features glm52
  • cargo test --release -p openinfer-glm52 --lib — 86 passed, 0 failed, 20 ignored
  • official-vLLM MTP front golden gate
  • official-vLLM layer-78 EP8 golden gate
  • latest-main 8×H200 production-path hidden-boundary, slot-reuse, and mixed-rank gate — 1 passed in 234.13 s
  • latest-main 8×H200 layer-6 EP8 oracle gate — 1 passed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project (see docs/conventions/coding-style.md).
  • I have performed a self-review of my own code.
  • I have formatted my commits according to Commitizen conventions.
  • I have run the local test suite and all tests pass (see CLAUDE.md).

xiaguan added 9 commits July 25, 2026 07:57
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
Signed-off-by: xiaguan <751080330@qq.com>
@xiaguan
xiaguan force-pushed the feat/glm52-native-mtp-forward branch from 8f83dcd to 8612129 Compare July 25, 2026 12:19
Signed-off-by: xiaguan <751080330@qq.com>
@xiaguan

xiaguan commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3b2c74353d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@xiaguan
xiaguan merged commit 662650a into main Jul 26, 2026
15 checks passed
@xiaguan
xiaguan deleted the feat/glm52-native-mtp-forward branch July 26, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant