Skip to content

feat(deepseek_v4): add the multi-token-prediction (MTP) module - #1

Open
nh13 wants to merge 1 commit into
dsv4/01-core-modelfrom
dsv4/02-mtp
Open

nh13 wants to merge 1 commit into
dsv4/01-core-modelfrom
dsv4/02-mtp

Conversation

@nh13

@nh13 nh13 commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Stacked follow-on to ml-explore#1797 (the base-model PR), opened in my fork so that PR stays single-concern.

Adds the DeepSeek-V4 MTP (multi-token prediction) module — MTPBlock plus mtp_forward / make_mtp_cache, unit-tested on a freshly-built model. It is scaffolding: real checkpoints ship MTP heads that do not map to this module yet, so sanitize drops them and loads the base model. The speculative-decode wiring and the MTP weight loading that consume this module come in later PRs.

(Placeholder description — edit as needed.)

Adds the DeepSeek-V4 MTP head (MTPBlock) plus mtp_forward / make_mtp_cache,
extracted from the base-model PR as a self-contained follow-up. The module is
scaffolding for MTP decoding: it builds and is unit-tested on a fresh model,
but real checkpoints ship MTP heads that do not map to it yet, so sanitize
drops them and loads the base model. The speculative-decode path and the MTP
weight loading that consume this module follow in later PRs.
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