Weight-Only Quantization focused on weights, which are fixed after training and can be quantized once before deployment. This post turns to tensors created during inference. Activations depend on the input token, sequence position, and previous layers. Their ranges can change from request to request, and a few channels may contain persistent outliers. This makes activation quantization harder than weight-only quantization.
Activation and Floating-Point Quantization.Photo by Bruno Martins. Some rights reserved.
The post on weight-only quantization introduced scales, zero points, and quantization granularity for fixed weights. The same concepts apply to activations, but the quantization parameters may now need to follow values that do not exist until inference begins.
Consider an activation tensor entering a linear layer. A static activation quantizer uses scales chosen during calibration. It is fast because the scales are already known, but a deployment input outside the calibration range may be clipped. A dynamic activation quantizer measures the tensor at runtime. It adapts to each input but adds reduction and scaling work to the inference path.
Source: Machine Learning Mastery — Read the full article on the original site ↗
Get the best of this topic in your inbox
Join the newsletter. A short, useful digest, no spam.
