Glossary#

Terms used across these docs, in plain words.

algorithm#

One concrete way of computing an operation, such as summing a matrix product's terms as a balanced tree in bfloat16, or a fused attention kernel that rounds its weights to bfloat16. A named algorithm has its own bounds, measured from the operation's reference. See Algorithms.

any-order tolerance#

The bound from tolerance(standard="any_order"): how far the output of an implementation that adds in any order, without overflowing, can be from the reference. It is wider than the normal tolerance.

backward error#

A way to bound an error by the input instead of the output: a result has a small backward error when it is the exact answer for an input close to the real one. The matrix exponential's tolerance says a correct result is exp(A + dA) for a small dA.

bfloat16#

A 16-bit floating-point format with float32's 8 exponent bits and 8 bits of precision: float32's range, with far less precision.

boundary#

A step where every correct implementation of an operation turns an exact intermediate value into a finite-precision number, such as the rounding of each partial sum or the final rounding to the output format. ExactRef's tolerances budget one rounding at each boundary. r.boundaries lists an operation's boundaries.

chain#

A computation with several steps, checked step by step by passing each step's result into the next operation. See Chains and any_of.

compute format#

The format an implementation rounds and adds in at the required steps. It is float32 by default for inputs narrower than float32 (bfloat16, float16 and the float8 formats) and the input format otherwise. Set it with the compute argument of tolerance() and covers().

correctly rounded#

The exact result rounded once, so that no value of the format is a better answer under the rounding mode. Every rounded ExactRef returns is correctly rounded.

enclosure#

A certified interval around an exact value: a midpoint and a radius, with the exact value no further than the radius from the midpoint. r.exact holds one per element.

finite range#

The lowest and highest finite output a correct implementation can produce, returned by finite_range().

float8#

The 8-bit floating-point formats, such as float8_e4m3fn and float8_e5m2, named after their exponent and mantissa bits. Some have no infinity, and the fnuz ones also have no negative zero.

flush to zero#

A hardware or library mode that replaces subnormal values with zero, as torch.set_flush_denormal(True) does. Say so with flush_to_zero=True.

fused multiply-add#

Computing a * b + c with one rounding instead of two (FMA).

normal accumulation#

How ordinary kernels add: in index order, or in 2 or 4 interleaved SIMD-style lanes, in the compute format, each product rounded and then added, starting a new partial sum where adding the next value would overflow. The default tolerance covers it.

normal answer#

The output of normal accumulation in index order, emulated exactly, which normal() returns: what an ordinary implementation computes.

overflow#

A result too large for its format. Depending on the format and the overflow argument, it becomes infinity, the largest finite value, or NaN.

reference#

The exact answer rounded once to the output format: r.rounded.

rounding mode#

The rule that picks which value of the format an exact result becomes: to nearest with ties to even (the default) or ties away from zero, toward zero, toward +inf, or toward -inf.

saturate#

Overflow handling that gives the largest finite value instead of infinity or NaN: overflow="saturate".

subnormal#

A value smaller in magnitude than the format's smallest normal number, held with fewer bits of precision. float32's subnormals reach down to about 1.4e-45.

ties to even#

The rule for an exact value exactly halfway between two values of the format: pick the one whose last bit is 0. It is the default rounding.

tolerance#

Per element, how far a correct implementation's finite output can be from the reference, for these inputs: tolerance(). It is computed from the inputs and the operation's boundaries, not fixed per dtype.

ulp#

Unit in the last place: the spacing between neighboring values of a format at a given size. For float32 values between 1 and 2 it is 2**-23.