IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /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​

  • ​indexer_score: Lightning-indexer scores read straight out of a paged compressed leaf.
  • ​latent_sparse_attention: Sparse attention over a shared K=V latent held in two paged leaves.
  • ​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.

Was this page helpful?