detect_quant_format

Function detect_quant_format 

Source
pub fn detect_quant_format(
    config: &ModelConfig,
    store: &WeightStore,
) -> Result<Box<dyn QuantFormat>>
Expand description

2026-09-25: Pick the QuantFormat for a checkpoint.

  1. A quantization_config whose quant_method is modelopt, compressed-tensors or fp8 selects that layout directly. The quant_algo and format are logged or stored, not used to choose.
  2. Otherwise the layout comes from weight_map::detect_nvfp4_variant (an unrecognised method is warned about first).
  3. When that finds no quantized weights (Bf16Raw), it warns and returns a ModeloptFormat.

The ignore list is the config’s ignore_modules, or empty without a config.