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
attention
Registers attention graph ops (MHA, MLA, fused QKV) and dispatches them to the nn.attention kernels.
comptime valuesβ
loggerβ
comptime logger = Logger(stdout, prefix=String(""), source_location=False)
Structsβ
- β
FlashAttentionGPU: Registers themo.mha.no_cachegraph op with the graph compiler. - β
MaskedFlashAttentionGPU: Registers themo.composite.masked_flash_attention_gpugraph op with the graph compiler. - β
MLAIndexerRaggedFloat8Paged: Registers themo.mla.indexer.ragged.float8.pagedgraph op with the graph compiler. - β
NoMaskFlashAttentionCPU: Registers themo.composite.no_mask_flash_attention_cpugraph op with the graph compiler. - β
PaddedFlashAttentionGPU: Registers themo.mha.padded.no_cachegraph op with the graph compiler. - β
RaggedFlashAttentionGPU: Registers themo.mha.ragged.no_cachegraph op with the graph compiler. - β
Struct_cross_attention_ragged_paged: Registers themo.cross_attention.ragged.pagedgraph op with the graph compiler. - β
Struct_fused_qk_rope_padded_paged: Registers themo.fused_qk_rope.padded.pagedgraph op with the graph compiler. - β
Struct_fused_qk_rope_ragged_paged: Registers themo.fused_qk_rope.ragged.pagedgraph op with the graph compiler. - β
Struct_fused_qk_rope_ragged_paged_with_position_id: Registers themo.fused_qk_rope.ragged.paged.with_position_idgraph op with the graph compiler. - β
Struct_fused_qkv_index_matmul_padded_ragged: - β
Struct_fused_qkv_index_matmul_padded_ragged_scale_mxfp8: Registers themo.fused_qkv_index_matmul.ragged.paged.scale.mxfp8graph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_paged: Registers themo.fused_qkv_matmul.padded.pagedgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged: Registers themo.fused_qkv_matmul.ragged.pagedgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_bias: Registers themo.fused_qkv_matmul.ragged.paged.biasgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_bias_quantized: Registers themo.fused_qkv_matmul.ragged.paged.bias.quantizedgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_quantized: Registers themo.fused_qkv_matmul.ragged.paged.quantizedgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_scale: Registers themo.fused_qkv_matmul.ragged.paged.scalegraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_scale_bias: Registers themo.fused_qkv_matmul.ragged.paged.scale.biasgraph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_scale_float4: Registers themo.fused_qkv_matmul.ragged.paged.scale.float4graph op with the graph compiler. - β
Struct_fused_qkv_matmul_padded_ragged_scale_mxfp8: Registers themo.fused_qkv_matmul.ragged.paged.scale.mxfp8graph op with the graph compiler. - β
Struct_mha_decode_num_partitions: Registers themo.mha.decode.get_num_partitionsgraph op with the graph compiler. - β
Struct_mha_padded_paged: Registers themo.mha.padded.pagedgraph op with the graph compiler. - β
Struct_mha_ragged_paged_scalar_args: Registers themo.mha.ragged.pagedgraph op with the graph compiler. - β
Struct_mha_ragged_paged_sink_weights_scalar_args: Registers themo.mha.ragged.paged.sink_weightsgraph op with the graph compiler. - β
Struct_mla_compute_dispatch_args_scalar: Registers themo.mla.compute_dispatch_args.scalargraph op with the graph compiler. - β
Struct_mla_decode_graph_bf16_paged: Registers themo.mla.graph.decode.pagedgraph op with the graph compiler. - β
Struct_mla_decode_graph_bf16_paged_sparse: Registers themo.mla.graph.decode.paged.sparsegraph op with the graph compiler. - β
Struct_mla_decode_graph_paged_fp8: Registers themo.mla.graph.decode.paged.fp8graph op with the graph compiler. - β
Struct_mla_decode_graph_paged_fp8_sparse: Registers themo.mla.graph.decode.paged.fp8.sparsegraph op with the graph compiler. - β
Struct_mla_decode_ragged_paged: Registers themo.mla.decode.ragged.pagedgraph op with the graph compiler. - β
Struct_mla_decode_ragged_paged_scaled: Registers themo.mla.decode.ragged.paged.scaledgraph op with the graph compiler. - β
Struct_mla_decompress_k_cache_ragged_paged: Registers themo.mla.decompress.k.cache.ragged.pagedgraph op with the graph compiler. - β
Struct_mla_prefill_graph_bf16_paged: Registers themo.mla.graph.prefill.pagedgraph op with the graph compiler. - β
Struct_mla_prefill_graph_decode_bf16_paged: Registers themo.mla.graph.prefill.decode.pagedgraph op with the graph compiler. - β
Struct_mla_prefill_graph_decode_bf16_paged_quantized: Registers themo.mla.graph.prefill.decode.paged.quantizedgraph op with the graph compiler. - β
Struct_mla_prefill_graph_decode_paged_fp8: Registers themo.mla.graph.prefill.decode.paged.fp8graph op with the graph compiler. - β
Struct_mla_prefill_graph_decode_paged_fp8_sparse: Registers themo.mla.graph.prefill.decode.paged.fp8.sparsegraph op with the graph compiler. - β
Struct_mla_prefill_graph_decode_paged_sparse: - β
Struct_mla_prefill_graph_paged: Registers themo.mla.graph.prefill.paged.fp8graph op with the graph compiler. - β
Struct_mla_prefill_ragged_paged: Registers themo.mla.prefill.ragged.pagedgraph op with the graph compiler. - β
Struct_mla_prefill_ragged_plan: Registers themo.mla.prefill.ragged.plangraph op with the graph compiler. - β
Struct_mla_prefill_sparse_paged: Registers themo.mla.prefill.sparse.pagedgraph op with the graph compiler. - β
Struct_mla_prefill_sparse_paged_fp8: Registers themo.mla.prefill.sparse.paged.fp8graph op with the graph compiler. - β
WithMaskFlashAttentionCPU: Registers themo.composite.masked_flash_attention_cpugraph op with the graph compiler. - β
WithMaskFlashAttentionSplitKVCPU: Registers thewith_mask_flash_attention_split_kv_cpugraph op with the graph compiler.
Functionsβ
- β
with_mask_flash_attention_split_kv_cpu_shape: Computes the output shape for thewith_mask_flash_attention_split_kv_cpugraph op.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!