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
selective_scan_update_gpu
selective_scan_update_gpu[kernel_dtype: DType, DSTATE: Int, state_out_LT: TensorLayout, output_LT: TensorLayout, state_in_LT: TensorLayout, x_LT: TensorLayout, dt_LT: TensorLayout, A_LT: TensorLayout, B_LT: TensorLayout, C_LT: TensorLayout, D_LT: TensorLayout, z_LT: TensorLayout, dt_bias_LT: TensorLayout](total_batch_dim: Int, batch: Int, dim: Int, group_size: Int, delta_softplus: Int8, state_out: TileTensor[kernel_dtype, state_out_LT, MutExternalOrigin], output: TileTensor[kernel_dtype, output_LT, MutExternalOrigin], state_in: TileTensor[kernel_dtype, state_in_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], dt_bias: TileTensor[kernel_dtype, dt_bias_LT, MutExternalOrigin], state_out_strides: IndexList[3], output_strides: IndexList[2], state_in_strides: IndexList[3], x_strides: IndexList[2], dt_strides: IndexList[2], A_strides: IndexList[2], B_strides: IndexList[3], C_strides: IndexList[3], D_strides: IndexList[1], z_strides: IndexList[2], dt_bias_strides: IndexList[1])
GPU kernel for selective scan update (single step).
Each thread processes one (batch, dim) pair. Reads initial state from state_in, writes updated state to state_out.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!