# Configuration

## Configuration

The configuration classes are the way to specify how a task should be done. Here is how a quantization can be configered:

1. Quantization: Performed by the `~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`.

### QuantizationConfig

#### class optimum.furiosa.QuantizationConfig

[\<source>](https://github.com/huggingface/optimum.furiosa/blob/vr_/optimum/furiosa/configuration.py#L237)

( with\_quantize: bool = True normalized\_pixel\_outputs: Sequence = None )

Parameters

* **with\_quantize** (`bool`, defaults to `True`) — WWhether to put a Quantize operator at the beginning of the resulting model.
* **normalized\_pixel\_outputs** ( `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.

### CalibrationConfig

#### class optimum.furiosa.CalibrationConfig

[\<source>](https://github.com/huggingface/optimum.furiosa/blob/vr_/optimum/furiosa/configuration.py#L29)

( dataset\_name: str dataset\_config\_name: str dataset\_split: str dataset\_num\_samples: int method: CalibrationMethod percentage: Optional = None )

Parameters

* **dataset\_name** (`str`) — The name of the calibration dataset.
* **dataset\_config\_name** (`str`) — The name of the calibration dataset configuration.
* **dataset\_split** (`str`) — Which split of the dataset is used to perform the calibration step.
* **dataset\_num\_samples** (`int`) — The number of samples composing the calibration dataset.
* **method** (`CalibrationMethod`) — The method chosen to calculate the activations quantization parameters using the calibration dataset.
* **percentage** (`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.

### FuriosaConfig

#### class optimum.furiosa.FuriosaAIConfig

[\<source>](https://github.com/huggingface/optimum.furiosa/blob/vr_/optimum/furiosa/configuration.py#L255)

( opset: Optional = None quantization: Optional = None calibration: Optional = None \*\*kwargs )
