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

mha_mask

Mask types and the MHAMask trait for multi-head attention kernels.

Defines the MHAMask trait and concrete implementations including CausalMask, NullMask, SlidingWindowCausalMask, and MaterializedMask. Masks encode which query-key pairs are visible and determine per-tile iteration strategies used by prefill and decode kernels.

comptime values​

MASK_VALUE​

comptime MASK_VALUE = -10000

Structs​

Traits​

  • ​MHAMask: The MHAMask trait describes masks for MHA kernels, such as the causal mask.

Functions​

Was this page helpful?