Class ov::pass::ActivationsScaling#

class ActivationsScaling : public ov::pass::ModelPass#

Keeps activations of a reduced-precision model in range by scaling them down around Convolution/MatMul layers.

Linear layers can produce activations beyond the range of the scaled precision (e.g. above 65504 for f16), which turns into inf and then NaN at the following normalization. Since Conv(x / s) = Conv(x) / s, the pass divides the input of every Conv/MatMul whose input already has the scaled precision by the scale factor and multiplies the output back. The scale-up Multiplies are then moved down the graph and eliminated where possible: against the scale-down of the next Conv/MatMul, or at a normalization (see EliminateScalarMul).

The pass runs its own pipeline on a copy of the caller’s PassConfig: the caller’s callbacks apply to the inner passes, while the LPT transformations disabled here stay disabled only inside the pass. A scale factor <= 0 disables the pass.