Skip to content

vllm.model_executor.layers.quantization.quark.schemes.quark_scheme

Classes:

  • QuarkScheme –

    Abstract class used to describe the weight creation and forward pass

QuarkScheme

Bases: ABC

Abstract class used to describe the weight creation and forward pass of different quantization schemes supported by Quark.

Methods:

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:

  • layer

    (Module) –

    torch.nn.Module with the registered weights and other parameters relevant to the particular scheme.

  • x

    (Tensor) –

    input to the layer

  • bias

    (Tensor | None) –

    bias parameter

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.