vllm.config.quantization Âķ
Classes:
-
QuantSpecâQuantization spec for one layer kind (linear or MoE).
-
QuantizationConfigArgsâUser-facing quantization configuration.
Functions:
-
resolve_quantization_configâResolve
--quantizationshorthand and--quantization-configinto a
QuantSpec Âķ
Quantization spec for one layer kind (linear or MoE).
None on either side means the method class falls back to its own default (typically inherited from the checkpoint, or unquantized for online).
Attributes:
-
activation(QuantKeyField) âActivation quantization key, or a name from QUANT_KEY_NAMES.
-
weight(QuantKeyField) âWeight quantization key, or a name from QUANT_KEY_NAMES.
Source code in vllm/config/quantization.py
QuantizationConfigArgs Âķ
User-facing quantization configuration.
See docs/features/quantization/online.md for the schema and shorthand string forms accepted on linear and moe.
Attributes:
-
ignore(list[str]) âLayers to skip quantization for.
-
linear(QuantSpec | None) âSpec applied to
LinearBaselayers. -
moe(QuantSpec | None) âSpec applied to
FusedMoEFactorylayers.
Source code in vllm/config/quantization.py
resolve_quantization_config(quantization, quantization_config) Âķ
Resolve --quantization shorthand and --quantization-config into a QuantizationConfigArgs.
quantization is a CLI shorthand that desugars into a base config via _ONLINE_SHORTHANDS. quantization_config is a dict or pre-built args object. When both are given, fields explicitly set in quantization_config take precedence over the shorthand.