IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python function

parse_quant_config

parse_quant_config()​

max.pipelines.weights.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