H1 - model optimisation
quantisation
-
if a model consists of enormous numbers of numerical parameters, it can be expensive
-
the numerical precision used to represent them therefore matters
-
a traditional representation is 32-bit floating point (FP32)
-
if a model had one billion parameters stored at 32 bits each,
-
lower precision representations can be used
quantisation
- representing model values using lower numerical precision to reduce inference resource requirements
-
it is useful for:
- smaller model footprint
- faster inference
- lower serving cost
-
the trade-off is deterioration in the numerical precision
-
post-training quantisation is when the model is first trained, then converted/represented at lower precision for deployment
-
quantisation-aware training (QAT) is when training accounts for the effects of lower-precision inference
other optimisation concepts
pruning
- removal of parts judged unnecessary
knowledge distillation
- a larger and more capable model (teacher) is used to train a smaller model (student) to imitate its useful behaviour