FSA: An Alternative Efficient Implementation of Native Sparse Attention Kernel
Not on the map. Why?
Abstract (arXiv)
Recent advances in sparse attention mechanisms have demonstrated strong potential for reducing the computational cost of long-context training and inference in large language models (LLMs). Native Sparse Attention (NSA), one state-of-the-art approach, introduces natively trainable, hardware-aligned sparse attention that delivers substantial system-level performance boosts while maintaining accuracy comparable to full attention. However, the kernel implementation of NSA forces a loop order that is only efficient with a relatively large number of query heads in each Grouped Query Attention (GQA) group, whereas existing LLMs widely adopt a much smaller number of query heads in each GQA group -- such an inconsistency significantly limits the applicability of this sparse algorithmic advance. In this work, we propose Flash Sparse Attention (FSA), an alternative kernel implementation that enables efficient NSA computation across a wide range of popular LLMs with a varied, smaller number of heads in each GQA group on modern GPUs. Compared to vanilla NSA kernel implementation, our empirical evaluation demonstrates that FSA achieves (i) up to 3.5x and on average 1.6x kernel-level latency reduction, (ii) up to 1.25x and 1.09x on average end-to-end training speedup on state-of-the-art LLMs, and (iii) up to 1.36x and 1.11x on average for prefill-phase speedup in LLM generative inference. The source code is open-sourced and publicly available at https://github.com/Relaxed-System-Lab/Flash-Sparse-Attention.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 33 of its 41 references that are in the map. First posted on arXiv 25 Aug 2025.
Builds on
33 of 41 references.
References · 33
- 2017Attention Is All You Needcited by 60,361
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2025Qwen3 Technical Reportcited by 8,820
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2024Qwen2 Technical Reportcited by 2,120
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
- 2024Yi: Open Foundation Models by 01.AIcited by 719
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inferencecited by 501
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
21 more
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
- 2024DuoAttention: Efficient Long-Context LLM Inference with Retrieval and Streaming Headscited by 288
- 2020Sparse Sinkhorn Attentioncited by 251
- 2025MoBA: Mixture of Block Attention for Long-Context LLMscited by 198
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 197
- 2018Online normalizer calculation for softmaxcited by 162
- 2024SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Accelerationcited by 160
- 2025XAttention: Block Sparse Attention with Antidiagonal Scoringcited by 137
- 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inferencecited by 123
- 2024SageAttention2: Efficient Attention with Thorough Outlier Smoothing and Per-thread INT4 Quantizationcited by 114
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
- 2025SageAttention3: Microscaling FP4 Attention for Inference and An Exploration of 8-Bit Trainingcited by 66
- 2019Explicit Sparse Transformer: Concentrated Attention Through Explicit Selectioncited by 62
- 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
- 2023HexGen: Generative Inference of Large Language Model over Heterogeneous Environmentcited by 31
- 2024Star Attention: Efficient LLM Inference over Long Sequencescited by 25
- 2025HexGen-2: Disaggregated Generative Inference of LLMs in Heterogeneous Environmentcited by 20
- 2025From 128K to 4M: Efficient Training of Ultra-Long Context Large Language Modelscited by 14
- 2024CHAI: Clustered Head Attention for Efficient LLM Inferencecited by 13
- 2024Core Context Aware Transformers for Long Context Language Modelingcited by 11
- 2023SEA: Sparse Linear Attention with Estimated Attention Maskcited by 10
Built on by
Citing papers per year: 2025: 1; 2026: 6.
7 papers.
- 2025NOSA: Native and Offloadable Sparse Attentioncited by 4
- 2026OServe: Accelerating LLM Serving via Spatial-Temporal Workload Orchestrationcited by 3
- 2026Rethinking Data Curation in LLM Training: Online Reweighting Offers Better Generalization than Offline Methodscited by 3
- 2026Power-based Partial Attention: Bridging Linear-Complexity and Full Attentioncited by 0
- 2026Superlinear Multi-Step Attentioncited by 0
- 2026HexAGenT: Efficient Agentic LLM Serving via Workflow- and Heterogeneity-Aware Schedulingcited by 0
- 2026Beyond Memory Leaderboards: Evaluating Scientific Memory as Budgeted Context Restorationcited by 0
- 2026Beyond Memory Leaderboards: Evaluating Scientific Memory as Budgeted Context Restoration18 Jul 2026
- 2026HexAGenT: Efficient Agentic LLM Serving via Workflow- and Heterogeneity-Aware Scheduling15 May 2026
- 2026Rethinking Data Curation in LLM Training: Online Reweighting Offers Better Generalization than Offline Methods19 Apr 2026
- 2026OServe: Accelerating LLM Serving via Spatial-Temporal Workload Orchestration12 Feb 2026
- 2026Superlinear Multi-Step Attention26 Jan 2026
- 2026Power-based Partial Attention: Bridging Linear-Complexity and Full Attention24 Jan 2026
- 2025NOSA: Native and Offloadable Sparse Attention15 Oct 2025