Skip to main content

from_row_norm_flat

Function from_row_norm_flat 

Source
pub fn from_row_norm_flat(
    spec: &FusedRowSpec,
    names: &StageNames,
    target: &SpatialTarget,
) -> Result<SpatialProgram, SpatialReject>
Expand description

The COMPOSITION-LAYOUT twin of super::from_tensor_op::from_fused_row’s RMSNorm: the same chain (square → fold → rsqrt-once → rescale → per-column weight), over a FLAT 1 × rows·cols tensor instead of a rows × cols one.

★ WHY A TWIN AND NOT A PARAMETER. from_fused_row gives the tensor the shape the SOURCE declared — right for a program that is one op, and exactly what a hundred green locks pin. Inside a composition the same tensor is a 1 × n activation whichever way the sugar views it, and the two views put element cols in different places. Both lower the identical arithmetic in the identical order, so they agree to the last bit; spatial_qwen_ops_lock checks that against the VM rather than against each other.