Flash-MSA: Accelerating Million-Token Training via Sparse Attention Kernels
·2026.07.13 05:46
Key point
An open-source kernel has been released that enables efficient training of MiniMax Sparse Attention (MSA) on Hopper and Blackwell GPUs.
1 / 2
Details
Recent frontier models such as DeepSeek-V4 and GLM-5.2 use Sparse Attention to improve inference speed, but code for training it efficiently has been lacking. Flash-MSA addresses this by providing high-performance open-source training kernels that support Hopper and Blackwell GPUs.
Key features of MSA (MiniMax Sparse Attention):
- Blockwise Sparsity: Instead of individual KV tokens, blocks of 128 are selected, improving caching efficiency.
- GQA (Grouped-Query Attention) applied: Uses GQA instead of the existing MLA approach, making it accessible across diverse model architectures while increasing the representational power of attention heads.
- Group-wise Specialization: Allows each proxy head to select a different KV subset, ensuring diversity in attention.
Key points of kernel design:
- Forward Pass: Performs proxy attention followed by Sparse Main Attention, caching only the top-k indices during proxy attention to reduce memory overhead.
- Backward Pass: Performs a Double-attention combined pass to compute gradients for both main attention and proxy attention, maximizing efficiency.
- Memory Optimization: Thanks to block-sparsity, only the block indices from the proxy forward results need to be stored throughout the training step, significantly reducing memory usage.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.