The configuration classes are the way to specify how a task should be done. Here is how a quantization can be configered:
~furiosa.FuriosaQuantizer
, quantization can be set using a ~furiosa.configuration.QuantizationConfig
. A calibration step is required in some cases (post training static quantization), which can be specified using a ~furiosa.configuration.CalibrationConfig
.( with_quantize: bool = True normalized_pixel_outputs: Sequence = None )
Parameters
bool
, defaults to True
) —
WWhether to put a Quantize operator at the beginning of the resulting model. Sequence[int
, defaults to None
) —:
A sequence of indices of output tensors in the ONNX model that produce pixel values in a normalized format
ranging from 0.0 to 1.0. If specified, the corresponding output tensors in the resulting quantized model
will generate pixel values in an unnormalized format from 0 to 255, represented as unsigned 8-bit integers (uint8). QuantizationConfig is the configuration class handling all the FuriosaAI quantization parameters.
( dataset_name: str dataset_config_name: str dataset_split: str dataset_num_samples: int method: CalibrationMethod percentage: Optional = None )
Parameters
str
) —
The name of the calibration dataset. str
) —
The name of the calibration dataset configuration. str
) —
Which split of the dataset is used to perform the calibration step. int
) —
The number of samples composing the calibration dataset. CalibrationMethod
) —
The method chosen to calculate the activations quantization parameters using the calibration dataset. Optional[float]
, defaults to None
) —
The percentage to use when computing the activations quantization ranges when performing the calibration
step using the Percentile method. CalibrationConfig is the configuration class handling all the FurioaAI parameters related to the calibration step of static quantization.
( opset: Optional = None quantization: Optional = None calibration: Optional = None **kwargs )