IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

varlen_selective_state_update_gpu

varlen_selective_state_update_gpu[kernel_dtype: DType, DSTATE: Int, state_LT: TensorLayout, x_LT: TensorLayout, dt_LT: TensorLayout, A_LT: TensorLayout, B_LT: TensorLayout, C_LT: TensorLayout, D_LT: TensorLayout, z_LT: TensorLayout, output_LT: TensorLayout, dt_bias_LT: TensorLayout, state_batch_indices_LT: TensorLayout](total_threads: Int, batch: Int, nheads: Int, dim: Int, nheads_ngroups_ratio: Int, pad_slot_id: Int32, dt_softplus: Int8, has_state_batch_indices: Int8, state: TileTensor[kernel_dtype, state_LT, MutExternalOrigin], x: TileTensor[kernel_dtype, x_LT, MutExternalOrigin], dt: TileTensor[kernel_dtype, dt_LT, MutExternalOrigin], A: TileTensor[kernel_dtype, A_LT, MutExternalOrigin], B: TileTensor[kernel_dtype, B_LT, MutExternalOrigin], C: TileTensor[kernel_dtype, C_LT, MutExternalOrigin], D: TileTensor[kernel_dtype, D_LT, MutExternalOrigin], z: TileTensor[kernel_dtype, z_LT, MutExternalOrigin], output: TileTensor[kernel_dtype, output_LT, MutExternalOrigin], dt_bias: TileTensor[kernel_dtype, dt_bias_LT, MutExternalOrigin], state_batch_indices: TileTensor[DType.int32, state_batch_indices_LT, MutExternalOrigin], state_strides: IndexList[4], x_strides: IndexList[3], dt_strides: IndexList[3], dt_bias_strides: IndexList[2], A_strides: IndexList[3], B_strides: IndexList[3], C_strides: IndexList[3], D_strides: IndexList[2], z_strides: IndexList[3], out_strides: IndexList[3])

GPU kernel for selective state update with multi-head support.