TorchLean API

FloatLib.Floats.Formats.OCP.FP8.E5M2

OCP FP8 E5M2 #

FloatLib.Floats.E5M2 is OCP E5M2 with a direct UInt8 runtime carrier, and E5M2.Family is its type-level identity. Its IEEE-style infinity and NaN encodings are properties of this format package, and the universal executable carrier does not assume them.

For addition, subtraction, multiplication, division, and square root, balanced and throughput planning select exhaustive byte tables, and latency planning selects the arithmetic kernels. Fused multiply-add uses the proved generic single-rounding kernel, which avoids a 16,777,216-entry ternary table and meets the same specification.

Reference #

Type-level identity of E5M2, selecting its descriptor, carrier, and kernels.

    Instances For

      The E5M2 encoding fits in its direct byte carrier.

      @[instance_reducible, always_inline]

      Package the five byte tables with the proved arithmetic FMA baseline.

      @[instance_reducible, always_inline]
      @[reducible, inline]

      OCP FP8 E5M2: the IEEE encoding with 5 exponent and 2 fraction bits, so binary16's exponent range with infinities and NaNs. Values are stored in one byte, and balanced and throughput planning answer the five basic operations from certified byte tables.

      ExecFloat.Binary (exponentBits := 5) (fractionBits := 2) is the same format on the general binary carrier, with directed rounding and status options.

      Instances For
        @[inline]

        Construct OCP E5M2 from a natural bit pattern, reduced to eight bits.

        Instances For
          @[inline]

          Read the complete OCP E5M2 encoding byte.

          Instances For