Module mtp_multi

Module mtp_multi 

Source
Expand description

Multi-module MTP proposer (MiniMax M2, DeepSeek-V3 style).

Differs from the single-module MtpHead in one way only: each draft slot dispatches to a different transformer module with its own weights and its own KV cache. Draft i is produced by modules[i].forward_one(previous_draft_token, previous_module_hidden).

Module count matches config.num_mtp_modules (3 for MiniMax M2.7). When the verify loop requests fewer drafts than modules (e.g. --num-drafts 1 for non-spec smoke), only the first K modules run — trailing modules stay idle but their state remains allocated.

Weight-level validation is deferred: the public tiny-random variant ships no MTP module weights, so unit tests exercise the dispatcher plumbing from randomly-initialized MtpHead instances and defer end-to-end acceptance-rate measurement to a session with the full 229B checkpoint staged. See docs/MINIMAX-M5-DESIGN.md §“Open questions”.

Structs§

MultiModuleMtpHead
N independent MTP modules, one per draft slot.
MultiModuleMtpState
Per-sequence state for MultiModuleMtpHead.