Module glm5next_mtp_head

Module glm5next_mtp_head 

Source
Expand description

2026-09-25: Glm5NextMtpHead: GLM-5.3’s MTP block as a DraftProposer, one draft token per forward_one.

Owner: model-arch (GLM-5.3 MTP drafter). Invariants:

  • The FP8 copy of the draft head is read only on the vocab-sharded sweep; every other sweep reads the BF16 lm_head.
x = eh_proj( concat( enorm(embed[token]), hnorm(target_hidden) ) )   [1, 2H] -> [1, H]
x = layers.{num_hidden_layers}(x)      DSA + routed MoE, plain residual (no mHC)
logits = lm_head( shared_head.norm(x) )              the target's own head
draft  = argmax(logits)

The block is sharded like a text layer: its routed experts are split across EP ranks and its DSA o_proj is row-parallel, so its forward needs the communicator (needs_comm).

Structs§

Glm5NextMtpHead
Glm5NextMtpProposerState
2026-09-25: Per-sequence drafter state: the block’s own indexer cache and KV block table.