Skip to main content

Python function

parse_quant_config

parse_quant_config()

max.pipelines.lib.parse_quant_config(huggingface_config, state_dict, dtype, state_dict_name_prefix='', ignored_modules_prefix='model.')

source

Parses scaled quantization config from HuggingFace config and state dict.

Parameters:

  • huggingface_config (AutoConfig) – HuggingFace model configuration.
  • state_dict (Mapping[str, WeightData]) – Weight state dict to inspect for scales.
  • dtype (DType) – Target dtype (e.g. float8_e4m3fn or packed fp4).
  • state_dict_name_prefix (str) – Optional prefix for state dict keys.
  • ignored_modules_prefix (str) – Prefix of modules to ignore when parsing.

Returns:

QuantConfig if supported, otherwise None.

Return type:

QuantConfig | None