nk_status_t nk_each_rmscast_bf16_best(
nk_f32_t const *x,
nk_f32_t const *gamma,
nk_bf16_t *y,
nk_size_t rows,
nk_size_t groups,
nk_size_t columns,
nk_size_t x_stride,
nk_size_t y_stride,
nk_f32_t epsilon,
nk_capability_t capabilities,
nk_stream_t stream);
Backends
nk_each_rmscast_bf16neonserialhaswellskylakecudaampererocmmetalnk_each_rmscast_f16neonserialcudarocmmetalnk_each_rmscast_e4m3neonserialhaswellskylakecudaadarocmmetalnk_each_rmscast_e5m2serialcudaadarocmmetalnk_each_rmscast_e2m3serialcudarocmmetalnk_each_rmscast_e3m2serialcudarocmmetalnk_each_rmscast_f32neonserialhaswellskylakecudarocmnk_each_rmscast_i8serialcudarocmmetalnk_each_rmscast_u8serialcudarocmmetal
Reads what nk_dot_output_dtype names for the output type, F32 for BF16, F16, E4M3, E5M2, E2M3 and E3M2, F64 for F32, I32 for I8 and U32 for U8, normalizes it like nk_each_rmsnorm_f32_best, and rounds every output like nk_cast of that pair, NaN payloads included, so a GEMM output becomes the next GEMM's input in one pass. Epsilon adds to mean(x²) of the raw input. Integer outputs are saturate(round_to_nearest_even(x / rms(x) × gamma)), where gamma carries the output quantization scale, and U8 suits only non-negative activations.
F32 inputs stay in F32 throughout, like the RMSNorm of types narrower than F32. F64 inputs stay in F64, from a sum of squares rescaled where squares leave its range through the products with gamma, rounding once into F32. I32 and U32 inputs sum in F64 and round their mean square to F32, where epsilon adds and everything after runs.
Parameters
Statuses