Quantization Range Optimization: Top 3 Criteria for Minimal Error

Optimizing the quantization range (min/max values) for each layer or group, often using metrics like Mean Squared Error (MSE), Kullback-Leibler divergence, or cosine similarity, is crucial to reduce overall quantization error.

The top 3

  1. Top 3 Range Optimization Criteria for Minimal Quantization Error: Achieving minimal error in LLM quantization range optimization relies on three key criteria: Min-Max (Absmax) calibration, Kullback-Leibler (KL) Divergence minimization, and Mean Squared Error (MSE) minimization. These methods determine the optimal scaling factors and zero points to map high-precision values to lower-precision integers, balancing efficiency and accuracy.
  2. Min-Max (Absmax) Calibration: The Baseline for Range Setting: Min-Max or Absmax calibration is a fundamental method where the quantization range is directly set by the observed minimum and maximum values of the floating-point data, or the absolute maximum for symmetric quantization. This straightforward approach defines the boundaries for mapping real numbers to discrete integer ranges, often used as a starting point for post-training quantization.
  3. KL Divergence: Minimizing Information Loss for Optimal Clipping: Kullback-Leibler (KL) Divergence is a crucial criterion for quantization range optimization, especially for activations, by minimizing the information loss between the original floating-point distribution and the quantized distribution. Techniques like Nvidia's TensorRT use KL divergence to find optimal clipping thresholds, ensuring the quantized model's output probabilities closely match the original.

Sources

Open the full topic