Skip to content

perf(glm5next): checkpoint target GDN state for MTP prefill - #536

Merged
lukealonso merged 1 commit into
perf/glm53-split-target-recurrent-cache-pagesfrom
perf/glm53-mtp-target-gdn-checkpoint
Aug 31, 2026
Merged

perf(glm5next): checkpoint target GDN state for MTP prefill#536
lukealonso merged 1 commit into
perf/glm53-split-target-recurrent-cache-pagesfrom
perf/glm53-mtp-target-gdn-checkpoint

Conversation

@voipmonitor

Copy link
Copy Markdown

Purpose and status

Status: implemented and qualified for GLM-5.3 MTP align-mode prefill.

GLM-5.3 MTP stores draft MLA KV independently from the target model's gated
delta network (GDN) recurrent state. The generic EAGLE scheduler disables
intermediate recurrent-state checkpoints because most speculative models must
replay a lookahead-dependent draft tail. Applying that blanket policy to
Glm5NextMTPModel also discards a valid target GDN checkpoint and can schedule
an additional target-only forward at an unaligned prompt tail.

This pull request permits target GDN checkpoint publication only when the MTP
draft architecture is Glm5NextMTPModel. Prefix-cache lookup continues to
drop and replay the lookahead-dependent draft tail through the existing EAGLE
cache-group policy. Other MTP architectures retain the generic scheduler
behavior.

Correctness contract

  • The target GDN checkpoint contains target recurrent state only.
  • Draft MLA KV remains independently owned and is not checkpointed by this
    path.
  • EAGLE prefix-cache lookup still invalidates the draft lookahead tail.
  • Non-GLM MTP and EAGLE architectures do not enable the exception.

Performance evidence

Hardware was four stock-clock NVIDIA RTX PRO 6000 Blackwell Workstation
Edition GPUs (physical devices 4-7), TP4/DCP1, B12X target attention, B12X
NVFP4 W4A4 MoE, B12X linear kernels and PCIe all-reduce, FlashKDA prefill,
MTP3 with B12X attention and Humming MoE, full CUDA graphs, FP8 target KV,
512-token target/recurrent cache blocks and max_num_batched_tokens=4096.
Each row is the median of three cold completion requests with one output token.

Exact prompt length Scheduler Median TTFT Prefill throughput
32,320 Generic EAGLE policy 2.26366 s 14,277.7 tok/s
32,320 GLM target GDN checkpoint 2.18174 s 14,813.9 tok/s
32,770 Generic EAGLE policy 2.28408 s 14,347.1 tok/s
32,770 GLM target GDN checkpoint 2.28757 s 14,325.3 tok/s

The 32,320-token request crosses a checkpoint boundary with an unaligned
3,648-token prompt tail. Reusing the target checkpoint removes one redundant
target-only forward and improves throughput by 3.75%. The 32,770-token request
does not expose that redundant schedule and remains neutral within 0.2%.

Validation

.venv/bin/python -m pytest -q \
  tests/v1/core/test_mamba_align_chunk_split.py \
  tests/models/test_glm5next_model.py \
  tests/v1/core/test_kv_cache_utils.py
181 passed

All pre-commit hooks for the changed files pass, including Ruff and mypy. The
scheduler unit test constructs the 32,320-token boundary case and verifies that
the remaining 3,648 prompt tokens join the checkpointed target tail instead of
forming a separate target-only step.

Six deterministic serving cases in the complete GLM-5.3 MTP stack selected
identical tokens between DCP1 and TP4/DCP4 full-CKV execution. The largest
selected-token log-probability delta was 0.00896.

Relationship to open work

This pull request is stacked on #535, which defines independent target MLA and
recurrent-state page geometry. PR #530 provides FlashKDA target prefill and
#517 provides DCP full-CKV target selection. Those pull requests do not alter
the MTP scheduler's recurrent-checkpoint eligibility.

AI assistance was used to implement, test, benchmark, and prepare this pull
request. The submitted behavior and evidence were reviewed against the source
and runtime logs by the human submitter.

@voipmonitor

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 30ee3e39-b5d3-48d1-a042-8401f42622e2

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8e00d and 9f27029.

📒 Files selected for processing (2)
  • tests/v1/core/test_mamba_align_chunk_split.py
  • vllm/v1/core/sched/scheduler.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Permit GLM-5.3 MTP to publish an internal target GDN checkpoint at a crossed align-mode cache boundary. Draft MLA KV remains independently owned, while the existing EAGLE cache-group policy continues to replay its lookahead-dependent tail.

This removes the target-only tail forward for unaligned prompts without changing other MTP architectures or speculative cache ownership.

Assisted-by: OpenAI Codex
Signed-off-by: Martin Vit <martin@voipmonitor.org>
@voipmonitor

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lukealonso
lukealonso merged commit f7851a3 into perf/glm53-split-target-recurrent-cache-pages Aug 31, 2026
1 of 2 checks passed
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.

2 participants