Module mtp_meta

Module mtp_meta 

Source
Expand description

2026-09-25: The one definition of an MTP proposer’s attention-metadata slab, packed by MtpHead::forward_one, forward_batch_position and DeepseekV4MtpHead::propose.

Owner: model-layers (MTP head). Invariants:

  • pack_mtp_attn_meta returns a slab only when it fits the caller’s region_bytes; otherwise it returns an error and builds nothing.

Constants§

MTP_META_OFFSET
2026-09-25: scratch byte offset of the single-sequence MTP metadata slab, used by MtpHead::forward_one and DeepseekV4MtpHead::propose. The target’s batched decode metadata starts at scratch + 32768. The batched propose writes its own propose_meta allocation instead.

Functions§

mtp_attn_meta_batch_dev
2026-09-30: The attention metadata pack_mtp_attn_meta_batch lays out at base for n rows (MtpBatchMetaLayout); max_blocks_per_seq is the step’s, set by its reader.
mtp_attn_meta_dev
2026-09-25: Pack one MTP attention-metadata slab, or return an error when it would not fit region_bytes.
pack_mtp_attn_meta