detect_nvfp4_variant

Function detect_nvfp4_variant 

Source
pub fn detect_nvfp4_variant(
    store: &WeightStore,
    config: &ModelConfig,
) -> Nvfp4Variant
Expand description

2026-09-25: Detect the on-disk weight format.

  1. config_declared_variant wins when it answers. A checkpoint with an ignore list can leave a projection unquantized, which tensor-name sniffing would misread.
  2. Otherwise the tensor names are sniffed, in this order: compressed-tensors weight_packed, then FP8 weight_scale_inv or an FP8E4M3 projection weight, then Bf16Raw when layer 0’s MLP gate_proj has no weight_scale, and Standard last.