Mojo struct
MHAAttentionConfig
struct MHAAttentionConfig[token_gen: Bool, config: MHAConfig[config.dtype], group: Int]
Implemented traits
AnyType,
AttentionConfig,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable
comptime members
depth_padded
comptime depth_padded = False if MHAAttentionConfig[token_gen, config, group].USE_EXPERIMENTAL_CDNA4_MHA_KERNEL else True
double_buffer
comptime double_buffer = True if MHAAttentionConfig[token_gen, config, group].USE_EXPERIMENTAL_CDNA4_MHA_KERNEL else False
full_kv
comptime full_kv = True if MHAAttentionConfig[token_gen, config, group].USE_EXPERIMENTAL_CDNA4_MHA_KERNEL else False
shared_kv
comptime shared_kv = False if MHAAttentionConfig[token_gen, config, group].USE_EXPERIMENTAL_CDNA4_MHA_KERNEL else True
USE_EXPERIMENTAL_CDNA4_MHA_KERNEL
comptime USE_EXPERIMENTAL_CDNA4_MHA_KERNEL = _cdna_4_or_newer() and get_defined_bool["USE_EXPERIMENTAL_CDNA4_MHA_KERNEL", False]() and not token_gen
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!