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 module
softmax
Provides numerically stable softmax kernels for CPU and GPU, including fused and online variants.
Functionsβ
- β
identity: Returns the input SIMD vector unchanged. - β
logsoftmax: Computes log-softmax over the given axis using a caller-supplied input lambda. - β
mul: Returns the element-wise productx * y. - β
reciprocal: Returns the element-wise reciprocal1 / x. - β
reduce_add_simd: This functions adds val to either the scalar value or the vector value depending on the step_simd_width. This is useful when the simd_width varies between iterations as in vectorize. - β
softmax: Computes softmax over the given axis ofinputand stores the result inoutput. - β
softmax_2_pass: Performs an unbatched softmax on an input tensor using the two-pass online algorithm. - β
softmax_3_pass: Performs an unbatched softmax on an input tensor using the three-pass algorithm. - β
softmax_kernel: GPU kernel implementing the three-pass softmax with optional sink-attention and logsoftmax variants. - β
softmax_with_temperature: GPU softmax with per-row temperature scaling. - β
sub: Returns the element-wise differencex - y.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!