For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
composite_rms_norm_rope_shape
def composite_rms_norm_rope_shape[dtype: DType, cos_sin_dtype: DType, rank: Int](input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], weight: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec], epsilon: Float32, weight_offset: Scalar[dtype], cos_vals: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cos_vals.static_spec], sin_vals: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=sin_vals.static_spec]) -> IndexList[rank]
Computes the output shape for the mo.composite.rms_norm_rope graph op.
Parameters:
- βdtype (
DType): Element type of theinputandweighttensors. - βcos_sin_dtype (
DType): Element type of thecos_valsandsin_valsRoPE tables. - βrank (
Int): Number of dimensions in theinputand output tensors.
Args:
- βinput (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec]): Activation tensor normalized by RMS then rotated by RoPE; the last dimension must be even. - βweight (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec]): Per-column scale weights applied after RMS normalization. - βepsilon (
Float32): Small constant added inside the RMS normalization square root for numerical stability. - βweight_offset (
Scalar[dtype]): Scalar offset added toweightbefore scaling. - βcos_vals (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cos_vals.static_spec]): Cosine table used by the RoPE rotation, matchinginputrank. - βsin_vals (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=sin_vals.static_spec]): Sine table used by the RoPE rotation, matchinginputrank.
Returns:
IndexList[rank]: The output shape, which matches the input shape.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!