---
title: "qkRmsNorm"
sidebar_label: "qkRmsNorm"
description: "Kotlin binding reference: qkRmsNorm."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[qkRmsNorm](qkRmsNorm.md)

# qkRmsNorm

[common]\
fun [qkRmsNorm](qkRmsNorm.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md)? = null, value: [Tensor](../Tensor/index.md)? = null, queryWeight: [Tensor](../Tensor/index.md)? = null, keyWeight: [Tensor](../Tensor/index.md)? = null, headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;

`qkRmsNorm(query: Tensor, key: Tensor? = null, value: Tensor? = null, queryWeight: Tensor? = null, keyWeight: Tensor? = null, headDim: Long = 0L, eps: Double? = null)`: the `qk_rms_norm` operator. Per-head RMS norm over packed attention projections: query, key and value in ONE call, no reshapes. Each contiguous `head_dim` run of `query` (and `key`, when present) is its own normalization group: `out = x / sqrt(mean(x^2) + eps) * w`. `value` passes through untouched (it rides along so one call serves the projection triplet). Equivalent to reshaping `[S, heads*head_dim]` to `[S, heads, head_dim]`, applying `rms_norm`, and reshaping back, with none of those steps.