vllm.model_executor.layers.quantization.quark.schemes
¶
Modules:
Classes:
-
QuarkNVFP4–Quark NVFP4 quantization scheme.
-
QuarkOCP_MX– -
QuarkScheme–Abstract class used to describe the weight creation and forward pass
-
QuarkW4A16Int4–Quark packed INT4 weight-only linear scheme via MPLinearKernel.
-
QuarkW4A8_MXFP4_FP8–- Weights: MXFP4 with E8M0 scales per block of 32
QuarkNVFP4
¶
Bases: QuarkScheme
Quark NVFP4 quantization scheme.
Supports loading NVFP4 checkpoints with the following structure: - weight: uint8, shape [out_features, in_features // 2] (packed FP4) - weight_scale: float8_e4m3fn, shape [out_features, in_features // group_size] - weight_scale_2: bfloat16/float32, scalar (global weight scale) - input_scale_2: bfloat16/float32, scalar (global input scale)
QuarkOCP_MX
¶
Bases: QuarkScheme, InputHadamardFusable
_expanding_scale_loader(weight_loader)
¶
Expand a 2-D block scale to one row per weight row.
A block_size=[R, 32] export carries one e8m0 value per R weight
rows; the kernels want one per row. At R == 1 the layouts already
coincide, so the loader is passed through untouched.
QuarkScheme
¶
Bases: ABC
Abstract class used to describe the weight creation and forward pass of different quantization schemes supported by Quark.
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.
QuarkW4A16Int4
¶
QuarkW4A8_MXFP4_FP8
¶
Bases: QuarkScheme
- Weights: MXFP4 with E8M0 scales per block of 32
- Activations: FP8 E4M3 (static per-tensor quantization)
Uses the AITER Triton kernel and falls back to emulation if AITER not available.