Mapping floats to integers: scale and zero-point
Quantization is, at its core, a linear remapping. You take a continuous range of floating-point values and squeeze it onto a small fixed set of integer levels, typically 256 of them for int8. The remapping is defined by two numbers: a scale factor, which says how much real-valued range each integer step covers, and a zero-point, which says which integer represents the real value zero. To quantize, you divide the float by the scale, round to the nearest integer, and add the zero-point. To dequantize, you subtract the zero-point and multiply by the scale. Everything else in quantization, from calibration to per-channel schemes, is really just decisions about how to pick good scale and zero-point values.
There are two common flavors of this mapping. Symmetric quantization forces the zero-point to sit exactly at zero and uses the same scale for positive and negative values, which is simpler and cheaper to compute but wastes range if the data isn't centered. Asymmetric quantization lets the zero-point float to wherever it needs to be, which fits skewed distributions (like activations after a ReLU, which are never negative) more tightly at the cost of a slightly more expensive dequantization step. Choosing between them is a real engineering decision made per-tensor, not a detail to gloss over.
