Mixed-precision arithmetic
Mixed-precision arithmetic is a form of floating-point arithmetic that uses numbers with varying widths in a single operation.[src]
Mixed-precision arithmetic is a form of floating-point arithmetic that uses numbers with varying widths in a single operation.[src] ==Overview== A common usage of mixed-precision arithmetic is for operating on inaccurate numbers with a small width and expanding them to a larger, more accurate representation.[src] For example, two half-precision or bfloat16 (16-bit) floating-point numbers may be multiplied together to result in a more accurate single-precision (32-bit) float.[src] In this way, mixed-precision arithmetic approximates arbitrary-precision arithmetic, albeit with a low number of possible precisions.[src] Iterative algorithms (like gradient descent) are good candidates for mixed-precision arithmetic.[src] In an iterative algorithm like square root, a coarse integral guess can be made and refined over many iterations until the error in precision makes it such that the smallest addition or subtraction to the guess is still too coarse to be an acceptable answer.[src] When this happens, the precision can be increased to something more precise, which allows for smaller increments to be used for the approximation.[src] Supercomputers such as Summit utilize mixed-precision arithmetic to be more efficient with regards to memory and processing time, as well as power consumption.[src] Loss scaling means multiplying the loss function by a constant factor during training, typically before backpropagation.[src] This is done to prevent the gradients from underflowing to zero when using low-precision data types.[src] If the unscaled loss is \mathcal{L} , the scaled loss is k\mathcal{L} where k is the scaling factor.[src] Since gradient scaling and loss scaling are mathematically equivalent by \frac{\partial(k\mathcal{L})}{\partial\mathbf{w}} = k\frac{\partial\mathcal{L}}{\partial\mathbf{w}} , loss scaling is an implementation of gradient scaling.[src] PyTorch AMP uses exponential backoff to automatically adjust the scale factor for loss scaling.[src] That is, it periodically increase the scale factor.[src] Whenever the gradients contain a NaN (indicating overflow), the weight update is skipped, and the scale factor is decreased.[src] ==References==[src]
17 sentences · 17 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Mixed-precision arithmetic." encyclopegia.org, 2024, https://encyclopegia.org/wiki/mixed-precision-arithmetic. Accessed 01 December 2026.
Chicago
"Mixed-precision arithmetic." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/mixed-precision-arithmetic.
APA
encyclopegia.org. (2024). Mixed-precision arithmetic. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/mixed-precision-arithmetic
Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON