Last updated: 2026-06-12

Inference Runtime

Rms Norm

All API Sections

T-CPU RMS_NORM implementation.

This is the scalar reference for RMS normalization and intentionally favors exactness and readable shape checks over throughput.

2 exports shown

struct

Params

#
pub const Params = struct

Inputs and outputs for one RMS_NORM call.

Parameters

input
Vector to normalize.
weight
Per-channel learned scale; must match `input` in length.
output
Destination vector; must match `input` in length.
eps
Small constant added inside the square root to keep division numerically stable.

src/zinc_rt/isa/cpu_zig/rms_norm.zig:12

function

run

#
pub fn run(params: Params) !void

Compute `output[i] = weight[i] * input[i] / sqrt(mean(input^2) + eps)`.

Scalar reference implementation; favors readable shape checks and bit-stable math over throughput. `output` do not exactly match `input.len`, otherwise void.

Parameters

params
Input, learned scale, output slice, and `eps`; see `Params`.

Returns

`error.EmptyInput` when `input` is zero-length, `error.ShapeMismatch` when `weight` or

src/zinc_rt/isa/cpu_zig/rms_norm.zig:24