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_fwd_cpu
def selective_scan_fwd_cpu[kernel_dtype: DType, DSTATE: Int](batch: Int, dim: Int, seqlen: Int, group_size: Int, delta_softplus: Int8, output: TileTensor[kernel_dtype, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], x: TileTensor[kernel_dtype, Storage=x.Storage, address_space=x.address_space, linear_idx_type=x.linear_idx_type], out_z: TileTensor[kernel_dtype, Storage=out_z.Storage, address_space=out_z.address_space, linear_idx_type=out_z.linear_idx_type], u: TileTensor[kernel_dtype, Storage=u.Storage, address_space=u.address_space, linear_idx_type=u.linear_idx_type], delta: TileTensor[kernel_dtype, Storage=delta.Storage, address_space=delta.address_space, linear_idx_type=delta.linear_idx_type], A: TileTensor[kernel_dtype, Storage=A.Storage, address_space=A.address_space, linear_idx_type=A.linear_idx_type], B: TileTensor[kernel_dtype, Storage=B.Storage, address_space=B.address_space, linear_idx_type=B.linear_idx_type], C: TileTensor[kernel_dtype, Storage=C.Storage, address_space=C.address_space, linear_idx_type=C.linear_idx_type], D: TileTensor[kernel_dtype, Storage=D.Storage, address_space=D.address_space, linear_idx_type=D.linear_idx_type], z: TileTensor[kernel_dtype, Storage=z.Storage, address_space=z.address_space, linear_idx_type=z.linear_idx_type], delta_bias: TileTensor[kernel_dtype, Storage=delta_bias.Storage, address_space=delta_bias.address_space, linear_idx_type=delta_bias.linear_idx_type], output_strides: IndexList[Int(3)], x_strides: IndexList[Int(4)], out_z_strides: IndexList[Int(3)], u_strides: IndexList[Int(3)], delta_strides: IndexList[Int(3)], A_strides: IndexList[Int(2)], B_strides: IndexList[Int(4)], C_strides: IndexList[Int(4)], D_strides: IndexList[Int(1)], z_strides: IndexList[Int(3)], delta_bias_strides: IndexList[Int(1)], ctx: Optional[DeviceContext] = None)
CPU kernel for selective scan forward pass.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!