vllm.model_executor.layers.quantization.compressed_tensors.schemes
¶
Modules:
-
compressed_tensors_scheme– -
compressed_tensors_w4a4_mxfp4– -
compressed_tensors_w4a8_mxfp4– -
compressed_tensors_w6a8_mxfp6– -
compressed_tensors_w8a8_mxfp8– -
compressed_tensors_wNa4–Weight N-bit INT scheme with INT4 activation quant via Humming.
-
compressed_tensors_wNa8–Weight N-bit INT scheme with INT8 activation quant via Humming.
-
compressed_tensors_wNa8o8–Weight N-bit INT scheme with static INT8 input/output activation quant.
Classes:
-
CompressedTensorsScheme–Abstract class used to describe the weight creation and forward pass
-
CompressedTensorsW4A4Mxfp4–Compressed tensors scheme for MXFP4.
-
CompressedTensorsW4A8Mxfp4–MXFP4 weights with dynamic FP8 activations in compressed-tensors format.
-
CompressedTensorsW6A8Mxfp6–Compressed tensors scheme for the mxfp6-pack-quantized format.
-
CompressedTensorsW8A8Mxfp8–Compressed tensors scheme for MXFP8 quantization (W8A8).
-
CompressedTensorsWNA4Int– -
CompressedTensorsWNA8Int– -
CompressedTensorsWNA8O8Int–
CompressedTensorsScheme
¶
Bases: ABC
Abstract class used to describe the weight creation and forward pass of different quantization schemes supported by CompressedTensors.
Methods:
-
apply_weights–Run the forward pass for the particular scheme. This is where
-
create_weights–Weight creation for the particular scheme. Inputs to this function.
-
get_min_capability–Get minimum device capability.
-
process_weights_after_loading–Called after weight loading is complete for any cleanup that
apply_weights(layer, x, bias)
abstractmethod
¶
Run the forward pass for the particular scheme. This is where scheme-specific dequant/quant steps/kernels should be applied.
Parameters:
create_weights(*args, **kwargs)
abstractmethod
¶
Weight creation for the particular scheme. Inputs to this function.
get_min_capability()
abstractmethod
classmethod
¶
Get minimum device capability.
process_weights_after_loading(layer)
abstractmethod
¶
Called after weight loading is complete for any cleanup that needs to occur.
CompressedTensorsW4A4Mxfp4
¶
Bases: CompressedTensorsScheme
Compressed tensors scheme for MXFP4.
Supports models quantized with the compressed-tensors mxfp4-pack-quantized format.
MXFP4 format: - 4-bit float weights (E2M1) packed into uint8 - Per-group E8M0 scales with group_size=32 - No global scale (unlike NVFP4)
On SM100+ with FlashInfer: true W4A4 (activations dynamically quantized). Otherwise: W4A16 weight-only via Marlin.
CompressedTensorsW4A8Mxfp4
¶
Bases: CompressedTensorsW4A4Mxfp4
MXFP4 weights with dynamic FP8 activations in compressed-tensors format.
The weight layout matches W4A4; only the activation quantization differs. The checkpoint's FP8 activations are used when a kernel supports them, otherwise this falls back to the W4A4 activation format.
CompressedTensorsW6A8Mxfp6
¶
Bases: CompressedTensorsScheme
Compressed tensors scheme for the mxfp6-pack-quantized format.
MXFP6 (E2M3) weights pack four values into three bytes, with per-group E8M0 scales (group_size=32). Activations are dynamically quantized to MXFP8, or kept in 16-bit for weight-only checkpoints.
CompressedTensorsW8A8Mxfp8
¶
Bases: CompressedTensorsScheme
Compressed tensors scheme for MXFP8 quantization (W8A8).
Loads pre-quantized MXFP8 weights from compressed-tensors checkpoints. Activations are dynamically quantized to MXFP8 at runtime.
MXFP8 format: - 8-bit float weights (E4M3) stored as float8_e4m3fn - Per-group E8M0 scales (uint8) with group_size=32 - Activations dynamically quantized to MXFP8 during inference
CompressedTensorsWNA4Int
¶
Bases: CompressedTensorsScheme
_build_input_quant_config()
¶
Build the config dict that BaseInputSchema.from_config expects.
CompressedTensorsWNA8Int
¶
Bases: CompressedTensorsScheme
_build_input_quant_config()
¶
Build the config dict that BaseInputSchema.from_config expects.
CompressedTensorsWNA8O8Int
¶
Bases: CompressedTensorsScheme
_pack_int_quantized_weight(layer)
¶
Normalize an int-quantized (plain int8) weight to the canonical
weight_packed int32 + weight_shape layout the MP kernels expect.