Skip to main content

Module einsum

Module einsum 

Source
Expand description

A bfloat16 contraction through the runtime’s extension module.

#1793’s precision table lists a bf16 CPU einsum “with documented f32 internal calculation/accumulation”, and asks for a contraction whose result distinguishes f32 accumulation from repeated bfloat16 rounding, compared against an independent reference with the specified output rounding. This module supplies that: the operands are widened to f32, the contraction accumulates there, and the result is rounded to bfloat16 once.

What it does not do is inherit a wider pattern surface. The operation is the pairwise contraction the table’s example needs, so a trace, a repeated label, or more than two operands is refused with a typed error rather than folded, which keeps this module’s body to the accumulation contract the row is about.

Structs§

Bf16Einsum
A pairwise contraction in bfloat16.

Constants§

BF16_EINSUM_FAMILY
The family the bfloat16 contraction belongs to.
BF16_SCALAR_IDENTITY
The canonical identity of the bfloat16 scalar a program declares.

Functions§

module
The module for the CPU backend’s engine identity.