Python APIs¶
This section covers the direct MATE Python APIs. Use these interfaces only when your framework or model architecture requires direct symbol-level integration.
Note
Check wrapper availability first. The wrapper-first workflow preserves more of the upstream package behavior and usually requires less code change.
Use direct MATE Python APIs when:
no wrapper matches your framework’s package surface
a wrapper exists but does not cover the feature you need
you need symbol-level control over a specific operator path
Supported API Entrypoints¶
Attention¶
Optimized entrypoints for FlashAttention, varlen, KV-cache, scheduler metadata, and MLA-related attention paths.
mate.flash_attn_combinemate.flash_attn_varlen_funcmate.flash_attn_with_kvcachemate.get_scheduler_metadatamate.get_mla_metadatamate.flash_mla_with_kvcachemate.flashmla.flash_mla_sparse_fwdmate.flashmla.flash_mla_sparse_fwd_pack8
SageAttention¶
Low-level pre-quantized SageAttention entrypoints for direct integration when
the sageattention wrapper is not the right surface.
mate.sage_attn_quantizedmate.sage_attn_quantized_with_kvcache
GEMM¶
Low-precision GEMM entrypoints, including 8-bit and mixed-dtype MoE GEMM, batched GEMM, and DeepGEMM-specific metadata / logits helpers.
mate.gemm.ragged_m_moe_gemm_8bitmate.gemm.ragged_m_moe_gemm_16bitmate.gemm.ragged_k_moe_gemm_8bitmate.gemm.ragged_k_moe_gemm_16bitmate.gemm.masked_moe_gemm_8bitmate.gemm.masked_moe_gemm_16bitmate.gemm.ragged_moe_gemm_mixed_dtypemate.gemm.masked_moe_gemm_mixed_dtypemate.gemm.bmm_fp16mate.gemm.bmm_fp8mate.gemm.gemm_fp8_nt_groupwisemate.deep_gemm.fp8_einsummate.deep_gemm.fp8_mqa_logitsmate.deep_gemm.tf32_hc_prenorm_gemmmate.deep_gemm.get_paged_mqa_logits_metadatamate.deep_gemm.fp8_paged_mqa_logits
Mega MoE¶
Distributed Mega MoE entrypoints for DeepGEMM-style
expert execution across a process group. Use this path when you need the
fused distributed FP8 expert runtime rather than a single MoE GEMM operator.
The same APIs are available through mate.deep_gemm and mate.mega_moe;
the mate.deep_gemm aliases are the usual integration surface.
mate.deep_gemm.get_symm_buffer_for_mega_moemate.deep_gemm.transform_weights_for_mega_moemate.deep_gemm.fp8_fp8_mega_moe
Hyperconnection¶
Direct Hyperconnection APIs exposed at the
top-level mate package and through mate.hyperconnection.
mate.mhc_premate.mhc_prenorm_gemm_sqrsummate.mhc_pre_big_fuse
GDN¶
Direct Gated Delta Network APIs for decode and prefill. See the GDN support page for support details and workflow guidance.
mate.gated_delta_rule_decodemate.gdn_prefill.chunk_gated_delta_rule
KDA¶
Direct KDA entrypoints for fused chunked KDA and decode when
the flash_kda wrapper is not the right integration surface.
mate.chunk_kdamate.kda.chunk_kdamate.kda.gated_delta_rule_decode
MSA¶
MSA (MiniMax Sparse Attention) covers MATE’s direct dense, paged, and sparse
attention APIs on MUSA. Use the fmha_sm100 wrapper first when your project
already targets that package surface. Use the direct MATE APIs below when you
need the native planning and runtime contract.
mate.msa_interface.msa_planmate.msa_interface.msamate.msa_interface.sparse_msa_planmate.msa_interface.sparse_msamate.msa_interface.sparse_topk_selectmate.msa_interface.sparse_decode_atten_func
The detail page documents the plan types, runtime metadata, and page table helper used by the direct API path.
MoE Routing & Gating¶
Direct MoE routing and gating entrypoints for workflows that need MATE’s native router path instead of a wrapper-level integration.
mate.hash_topkmate.moe_fused_gate