Quantization-aware training retrains a model with quantized weights and activations, allowing it to adapt to quantization-induced changes and retain performance at very low precision. section 8.3.3
Use quantization-aware training when:
- Targeting extremely low precision, including 2-bit quantization, while preserving model performance. section 8.3.3
- Accepting additional training cost in exchange for adaptation to quantization effects. section 8.3.3
- Choosing it over posttraining quantization, which requires no further training but typically remains limited to 8-bit or 6-bit precision. 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 bit widths, numeric ranges, and memory reductions for common lower-precision data types. section 8.3.3
