Skip to main content

Module reduction

Module reduction 

Source
Expand description

Reductions over bfloat16 storage.

#1785 asks for sum reduction with a specified accumulation rule and for tests that distinguish that rule from repeated rounding of the storage type. Two reductions do that here: one accumulates in f32 and rounds once, which is the contract this crate promises, and one rounds at every step. The second is not offered as the contract; it exists so tests can measure the difference instead of assuming it.

Functionsยง

product_in_f32_accumulation
Product of a slice, accumulating in f32 and rounding once.
sum_in_f32_accumulation
Sum a slice, accumulating in f32 and rounding once at the end.
sum_with_per_step_rounding
Sum a slice, rounding to bfloat16 after every step.