Uniform quantization maps a numerical range into discrete levels separated by equal-sized intervals. Its regular structure simplifies hardware implementation and can reduce computational and energy costs. section 8.3.3
Quantization choices involve distinct trade-offs:
- Nonuniform quantization varies interval sizes to match data distributions and potentially reduce quantization error. section 8.3.3
- Quantization-aware training retrains with quantized weights and activations, while posttraining quantization applies quantization without further training. section 8.3.3
Table 8.1 Comparison of data types
|
Data type
|
Bit width
|
Range
|
Memory reduction from FP32
|
|---|---|---|---|
|
float32
|
32 bits
|
≈ ± 3.4 × 10^{38}
|
–
|
|
float16
|
16 bits
|
≈ ± 6.5 × 10^{4}
|
50%
|
|
int8
|
8 bits
|
-128 to 127
|
75%
|
|
int4
|
4 bits
|
-8 to 7
|
87.5%
|
Compare float32, float16, int8, and int4 bit widths, numerical ranges, and memory reductions when assessing quantization choices. section 8.3.3
