TorchLean API

FloatLib.Floats.Formats.FiniteOnly.E5M2FNUZ

Finite-only E5M2FNUZ #

E5M2FNUZ gives the ONNX finite, NaN-supporting, unsigned-zero E5M2 variant a distinct Lean type. That nominal identity prevents accidental interchange with OCP E5M2, whose infinity and signed zero behavior differs even though both formats occupy one byte.

The runtime carrier is one UInt8. Balanced and throughput policies select exhaustive proved byte tables for addition, subtraction, multiplication, division, and square root; latency uses the exact arithmetic baseline. Fused multiply-add uses the proved generic single-rounding kernel.

Reference #

Finite E5M2FNUZ with one NaN code, unsigned zero, and direct byte storage.

    Instances For
      @[instance_reducible, always_inline]

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

      @[inline]

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

      Instances For
        @[inline]

        Read the complete E5M2FNUZ encoding byte.

        Instances For