DSA(DeepSeek Sparse Attention)是 DeepSeek 提出的一种稀疏注意力机制,主要用于降低大模型在长上下文场景下的 Attention 计算和 KV Cache 读取开销
TL;DR - DeepSeek Sparse Attention (DSA) accelerates long-context inference by selecting the Top-K most relevant historical tokens before computing exact attention. This reduces attention computation and KV-cache bandwidth demands.
- A Lightning Indexer scores historical tokens against each query.
- Sparse Attention accesses only the keys and values selected by Top-K ranking.
- Key implementation challenges include Top-K overhead, non-contiguous KV access, GPU memory coalescing, and sparse-kernel optimization.