Chip Foundry Services Request Assessment

Gradient Scaling

Gradient scaling, the general technique underlying loss scaling, multiplies gradients by a chosen factor before any precision-limited numeric operation that might otherwise lose small gradient values to underflow, then divides by that same factor afterward to restore the gradients' correct, unscaled magnitude before the optimizer applies them. This scale-up-then-scale-down pattern can be applied dynamically, automatically adjusting the scaling factor based on whether numeric overflow or underflow was actually observed in recent training steps, rather than using a single fixed scaling factor throughout an entire training run.