pub enum F32RmsNormArithmetic {
ScalarReciprocalSqrt,
ScalarDivideSqrt,
Lanes4ReciprocalSqrt,
Lanes8ReciprocalSqrt,
Lanes16ReciprocalSqrt,
Lanes32ReciprocalSqrt,
TorchCascade4ReciprocalSqrt,
TorchCascade8ReciprocalSqrt,
F64ReciprocalSqrt,
}Expand description
Arithmetic used by rms_norm_with_arithmetic to form RMSNorm’s scale.
The scalar reciprocal-square-root path is the f32 reference used by production code. The other modes make the exact CPU-fp32 fixture able to discriminate reduction precision and reciprocal placement without changing that normal path.
Variants§
ScalarReciprocalSqrt
Left-to-right f32 reduction and sqrt(value).recip().
ScalarDivideSqrt
Left-to-right f32 reduction and 1.0 / sqrt(value).
Lanes4ReciprocalSqrt
Four f32 partial sums, then sqrt(value).recip().
Lanes8ReciprocalSqrt
Eight f32 partial sums, then sqrt(value).recip().
Lanes16ReciprocalSqrt
Sixteen f32 partial sums, then sqrt(value).recip().
Lanes32ReciprocalSqrt
Thirty-two f32 partial sums, then sqrt(value).recip().
TorchCascade4ReciprocalSqrt
The reference stack’s own cascade reduction over a 4-wide vector, then
sqrt(value).recip(). See torch_cascade_sum.
TorchCascade8ReciprocalSqrt
The reference stack’s cascade reduction over an 8-wide vector — the width an ARM build
with AT_BUILD_ARM_VEC256_WITH_SLEEF uses, which the pinned oracle reports.
F64ReciprocalSqrt
f64 reduction and scale calculation, narrowed only at the final scale.
Implementations§
Source§impl F32RmsNormArithmetic
impl F32RmsNormArithmetic
Sourcepub const WIDENED_F64: Self = Self::F64ReciprocalSqrt
pub const WIDENED_F64: Self = Self::F64ReciprocalSqrt
The variant that removes this operation’s f32 reduction rounding, for attribution probes.
Trait Implementations§
Source§impl Clone for F32RmsNormArithmetic
impl Clone for F32RmsNormArithmetic
Source§fn clone(&self) -> F32RmsNormArithmetic
fn clone(&self) -> F32RmsNormArithmetic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more