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 struct
MHAAttentionConfigRDNA
struct MHAAttentionConfigRDNA[token_gen: Bool, config: MHAConfig[config.dtype], group: Int]
Holds the fixed RDNA Wave32 multi-head attention configuration and index math.
Parameterizes a single attention kernel shape (16x16x16 WMMA) for both prefill and decode passes, and exposes the head, tile, and offset helpers the kernel uses to map block and lane IDs to Q/K/V rows in global memory.
Parametersβ
- βtoken_gen (
Bool): Whether the kernel is running in decode (token-by-token) generation mode versus prefill. - βconfig (
MHAConfig[config.dtype]): The base multi-head attention configuration supplying head counts and tile dimensions. - βgroup (
Int): Group-query attention group size (number of query heads sharing one key/value head).
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable
comptime membersβ
depth_paddedβ
comptime depth_padded = True
double_bufferβ
comptime double_buffer = False
double_buffer_k_onlyβ
comptime double_buffer_k_only = False
full_kvβ
comptime full_kv = False
shared_kvβ
comptime shared_kv = False
Methodsβ
q_head_idxβ
q_tile_idxβ
kv_head_idxβ
get_mma_shapeβ
get_q_offsetβ
get_output_offsetβ
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!