pub struct QuantizationConfig {
pub quant_method: String,
pub quant_algo: String,
pub format: String,
pub ignore_modules: Vec<String>,
}Expand description
Advertised weight-quantization layout, as declared in the HF
config.json’s quantization_config block (or a sibling
hf_quant_config.json). This is the authoritative signal for
format dispatch — the QuantFormat trait prefers this over
tensor-name sniffing, matching the dispatch model used by vLLM /
TensorRT-LLM / SGLang.
quant_method is the serialization scheme:
"compressed-tensors"— Neural Magic / llm-compressor. Usesweight_packed+weight_global_scale+input_global_scale. Commonly paired withformat = "nvfp4-pack-quantized"or"float-quantized"."modelopt"— NVIDIA TensorRT ModelOpt. Usesweight(as the packed FP4 payload whenquant_algo == "NVFP4") +weight_scaleweight_scale_2+input_scale.
"fp8"— native FP8 block-scaled (e.g.Qwen/Qwen3.5-35B-A3B-FP8) withweight_scale_invsibling tensors.
ignore_modules holds the already-expanded list of module-path
patterns that should be loaded as dense BF16 rather than quantized.
Patterns use HF glob semantics (* matches any non-. sub-path).
Fields§
§quant_method: StringRaw quant_method string from the config. Stable values:
"compressed-tensors", "modelopt", "fp8".
quant_algo: StringModelOpt-specific algorithm label: "NVFP4", "FP8", …
Empty string for schemes that don’t declare one (e.g. plain FP8).
format: StringOptional format string (compressed-tensors uses this for
"nvfp4-pack-quantized" and friends).
ignore_modules: Vec<String>Module-path globs that should stay BF16 (the “ignore list” in
ModelOpt terminology; targets/exclude_modules in compressed-
tensors). Example entries: "lm_head",
"model.layers.*.self_attn*".
Trait Implementations§
Source§impl Clone for QuantizationConfig
impl Clone for QuantizationConfig
Source§fn clone(&self) -> QuantizationConfig
fn clone(&self) -> QuantizationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more