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

GPU flash-attention kernels and dispatch logic for prefill and decode.

Implements FA2 and FA3 flash-attention for NVIDIA and AMD GPUs, a naive two-BMM reference path, split-K decode partitioning, and the host-side dispatch layer (flash_attention_dispatch) that selects among them based on dtype, head depth, and target architecture.

Structs​

Functions​

Was this page helpful?