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 package

attention

Multi-head attention (MHA) and multi-head latent attention (MLA) kernels.

Shared utilities live here (masks, operands, config), with platform-specific implementations under cpu/ and gpu/.

Packages​

  • ​cpu: CPU flash-attention implementation for multi-head attention.
  • ​gpu: GPU multi-head attention (MHA), cross-attention, and multi-head latent attention (MLA) kernels. Vendor-specific implementations live under amd/ and nvidia/.

Modules​

  • ​mha_mask: Mask types and the MHAMask trait for multi-head attention kernels.
  • ​mha_operand: KV-cache operand descriptors and TMA tile builders for MHA GPU kernels.
  • ​mha_utils: Shared configuration types and dispatch helpers for MHA GPU kernels.