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 struct

FlashAttentionAlgorithm

struct FlashAttentionAlgorithm

Implemented traits​

AnyType, Copyable, Defaultable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members​

FLASH_ATTENTION_1​

comptime FLASH_ATTENTION_1 = FlashAttentionAlgorithm(Int(1))

FLASH_ATTENTION_2​

comptime FLASH_ATTENTION_2 = FlashAttentionAlgorithm(Int(2))

FLASH_ATTENTION_3​

comptime FLASH_ATTENTION_3 = FlashAttentionAlgorithm(Int(3))

NAIVE​

comptime NAIVE = FlashAttentionAlgorithm(Int(0))

Methods​

__init__​

def __init__() -> Self

def __init__(value: Int) -> Self

__eq__​

def __eq__(self, other: Self) -> Bool

Returns:

Bool

def __eq__(self, version: Int) -> Bool

Returns:

Bool

__ne__​

def __ne__(self, other: Self) -> Bool

Returns:

Bool

init​

def init(self, dtype: DType) -> Self

write_to​

def write_to(self, mut writer: T)