QuantizationConfig

Struct QuantizationConfig 

Source
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. Uses weight_packed + weight_global_scale + input_global_scale. Commonly paired with format = "nvfp4-pack-quantized" or "float-quantized".
  • "modelopt" — NVIDIA TensorRT ModelOpt. Uses weight (as the packed FP4 payload when quant_algo == "NVFP4") + weight_scale
    • weight_scale_2 + input_scale.
  • "fp8" — native FP8 block-scaled (e.g. Qwen/Qwen3.5-35B-A3B-FP8) with weight_scale_inv sibling 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: String

Raw quant_method string from the config. Stable values: "compressed-tensors", "modelopt", "fp8".

§quant_algo: String

ModelOpt-specific algorithm label: "NVFP4", "FP8", … Empty string for schemes that don’t declare one (e.g. plain FP8).

§format: String

Optional 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

Source§

fn clone(&self) -> QuantizationConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuantizationConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.