Skip to main content

draft_head_tensor

Function draft_head_tensor 

Source
pub fn draft_head_tensor(has: impl Fn(&str) -> bool, n: u32) -> String
Expand description

Which tensor is the DRAFT lm_head, for a standalone NextN/MTP draft GGUF whose block index is n. Preference order is the artifact’s, not ours — upstream step35.cpp:553 is layer.nextn.shared_head_head ? layer.nextn.shared_head_head : model.output.

Split out of MtpHead::load_draft purely so it is unit-testable: the loader needs a CUDA device and a multi-GB file, while the failure this guards is invisible to every exactness gate (a wrong head still produces CORRECT output — the verify arbitrates — it just accepts nothing). has is the tensor-presence predicate (src.has).