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 module

selective_scan

Selective scan kernel implementations for Mamba SSM prefill and decode.

Provides GPU and CPU forward-pass and update-step kernels for the selective scan (SSM) recurrence used by Mamba and Mamba-2, including the SSD (state-space duality) combined scan for variable-length batched prefill.

comptime values​

LOG2E​

comptime LOG2E = 1.4426950408889634

MAX_DSTATE​

comptime MAX_DSTATE = 16

Strides1D​

comptime Strides1D = IndexList[Int(1)]

Strides2D​

comptime Strides2D = IndexList[Int(2)]

Strides3D​

comptime Strides3D = IndexList[Int(3)]

Strides4D​

comptime Strides4D = IndexList[Int(4)]

Functions​