Mojo struct
MHAConfig
struct MHAConfig[dtype: DType]
Fieldsβ
- βnum_heads (
Int): - βdepth (
Int): - βpadded_depth (
Int): - βnum_queries_per_block (
Int): - βnum_keys_per_block (
Int): - βBK (
Int): - βWM (
Int): - βWN (
Int): - βnum_pipeline_stages (
Int): - βk_group_size (
Int): - βalgorithm (
FlashAttentionAlgorithm): - βswizzle_mode (
TensorMapSwizzle):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable,
Writable
Methodsβ
__init__β
__init__(num_heads: Int, depth: Int, num_queries_per_block: Optional[Int] = None, num_keys_per_block: Optional[Int] = None, BK: Optional[Int] = None, WM: Optional[Int] = None, WN: Optional[Int] = None, num_pipeline_stages: Int = 4, k_group_size: Int = 1, algorithm: FlashAttentionAlgorithm = FlashAttentionAlgorithm(-1), swizzle_mode: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_128B) -> Self
block_mβ
block_nβ
block_kβ
warp_mβ
warp_nβ
num_warps_mβ
num_warps_nβ
num_consumer_threadsβ
num_producer_threadsβ
num_threadsβ
swizzle_granularityβ
q_smem_sizeβ
kv_smem_sizeβ
k_smem_sizeβ
v_smem_sizeβ
p_smem_sizeβ
warp_scratch_smem_sizeβ
shared_mem_bytesβ
write_toβ
write_to(self, mut writer: T)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!