# Flash-MSA: Accelerating Million-Token Training With Sparse Attention Kernels

- **ID:** 627
- **Kind:** other
- **URL:** https://nanduruganesh.github.io/flash-msa/
- **Authors:** Ganesh Nanduru
- **Venue:** nanduruganesh.github.io
- **Source:** web
- **Language:** en
- **Access:** free
- **License:** MIT
- **License family:** Permissive (auto-classified)
- **Tags:** flash-msa, sparse-attention, cute, hopper, blackwell, minimax, kernels, blog, x
- **Topics:** sparse attention, CUDA kernels, long-context training
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Needs deep evaluation:** no
- **Page:** https://papers.projxon.ai/entries/627

## Summary

Flash-MSA implements MSA training (proxy block-sparse attention + fused proxy/main backward with an atomic KL trick so proxy grad = p_proxy − p_main) in CuTeDSL for H100/B200, CUDA 13. Tweet claims 400%+ speedup vs dense flash at long context. Warmup kernels run dense flash then train the proxy in the backward. Correctness vs eager PyTorch cosine sim typically ≥0.998. Requires adding kernel KL loss to CE. Inference kernels remain MiniMax-AI/MSA.

## Attributes

- **Purpose:** Open CuTeDSL training kernels for MiniMax Sparse Attention on Hopper/Blackwell
- **Scale:** H100 bf16 sweeps seq 4k–8k, 8–32 Q heads. Tweet 400%+ vs dense flash. GitHub 27 stars / 3 forks at check.
- **Time period:** Repo created 2026-07-10. Tweet 2026-07-12. Discord posted 2026-07-12. Pushed 2026-07-13.
- **Author type:** human

## Research notes

- Primary: technical blog. Discord/X https://x.com/gnanduru1/status/2076342414915342718 via fxtwitter. Code https://github.com/nanduruganesh/flash-msa (MIT); PyPI flash-msa; Megatron-LM fork https://github.com/nanduruganesh/Megatron-LM. Underlying MSA paper arXiv 2606.13392; official inference https://github.com/MiniMax-AI/MSA. Kernel/code item, not a hosted corpus, so no datasets_local row.

## Similar entries

- [Emergent Capabilities Arise Randomly from Learning Sparse Attention Patterns](https://papers.projxon.ai/entries/652) (paper, #652)
- [Reducing Doom Loops with Final Token Preference Optimization](https://papers.projxon.ai/entries/626) (dataset, #626)
- [HySparse2: Hybrid Sparse Attention with Two-Level KV Sharing](https://papers.projxon.ai/entries/1031) (paper, #1031)
- [LongCat Sparse Attention: Taming the Lightning via Streaming-aware Hierarchical Cross-Layer Indexing](https://papers.projxon.ai/entries/452) (paper, #452)
- [SmolLM3: smol, multilingual, long-context reasoner](https://papers.projxon.ai/entries/612) (model, #612)
- [FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision](https://papers.projxon.ai/entries/575) (paper, #575)
