plan_tensor_bytes

Function plan_tensor_bytes 

Source
pub fn plan_tensor_bytes(
    name: &str,
    shape: &[usize],
    element_bytes: usize,
    mixer: MixerKind,
    config: &ModelConfig,
) -> Result<TpBytePlan>
Expand description

Plan checkpoint storage BEFORE allocating a device buffer.

BF16/F32 keep their dtype. Packed experts require [N, K/2] bytes plus [N, K/32] E8M0 scales; a column split cannot bisect a 32-value group. Unknown non-packed tensors remain replicated. Runtime must separately enforce the model’s tensor inventory and exclude unsupported modalities.