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_utils

Shared configuration types and dispatch helpers for MHA GPU kernels.

Provides MHAConfig (tile/pipeline configuration), FlashAttentionAlgorithm (algorithm variant selector), mask-dispatch helpers, and partition-scheme types used by both prefill and decode attention kernels.

comptime values​

callback_fn_type​

comptime callback_fn_type = def[mask_t: MHAMask](mask: mask_t) raises capturing thin -> None

is_sm100​

comptime is_sm100 = (StringSlice("sm_100") in String(_accelerator_arch())) or (StringSlice("sm_103") in String(_accelerator_arch()))

is_sm90​

comptime is_sm90 = (StringSlice("sm_90") in String(_accelerator_arch()))

is_sm90or100​

comptime is_sm90or100 = is_sm90 or is_sm100

MHA_PDL_LEVEL​

comptime MHA_PDL_LEVEL = PDLLevel.OVERLAP_AT_END if get_defined_bool[StringSlice("MHA_PDL"), True]() else PDLLevel.OFF

Structs​

Traits​

Functions​

Was this page helpful?