Sample-Guided Exact Top-K Selection for Long-Context Sparse Attention

📅 2026-09-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
本文提出了一种样本引导的精确Top-K选择方法HPC-Ops Top-K,用于长上下文稀疏注意力机制中减少处理时间,通过局部粗略边界与完全行验证结合的方式提高效率。
📝 Abstract
Sparse attention bounds downstream attention work by retaining a fixed-size subset of indexed tokens, but its standalone exact Top-$K$ stage must still process materialized score rows whose length grows with context. Production radix selectors discover their first actionable boundary only after a complete-row pass, forcing another row-scale traversal before exact refinement. We observe that locating a compact upper tail requires substantially less resolution than identifying the exact rank boundary, and that fixed-stride partial views of the current row remain calibrated to the corresponding complete-row rank across ragged lengths. We present HPC-Ops Top-K, a sample-guided exact selector for ragged sparse-attention score rows. A fixed-stride view proposes a row-local coarse boundary; the mandatory complete-row pass certifies its sufficiency, forms the admitted candidate set, and initializes exact FP32 refinement over the unresolved frontier. A nested secondary boundary and exact recovery handle underfilled proposals before any output is committed, so sampling controls common-path work but never correctness. The GPU implementation fuses complete-row certification and candidate formation, and combines persistent, KV-split, and direct-exact execution behind graph-capturable ragged-row dispatch. We evaluate HPC-Ops Top-K on indexer scores from Hy4-Preview. It outperforms the fastest verified external exact baseline by $1.29$--$1.75\times$ across 20 operator configurations, with a $1.55\times$ geometric-mean speedup. It further achieves $1.36\times$ and $1.48\times$ speedups on two framework-derived sparse-attention traces. The implementation is available in HPC-Ops, Tencent's open-source high-performance operator library for LLM inference, at https://github.com/Tencent/hpc-ops.
Problem

Research questions and friction points this paper is trying to address.

Sparse Attention
Top-K Selection
Long-Context
Score Rows
Radix Selectors
Innovation

Methods, ideas, or system contributions that make the work stand out.

sample-guided
exact selector
fixed-stride view
coarse boundary
GPU implementation
S
Siran Liu
Tencent Inc.
Y
Yang Xue
Tencent Inc.
T
Theo Tang
Tencent Inc.
C
Changxu Shao
Tencent Inc.
Qian Cheng
Qian Cheng
University of Leeds
sustainable developmentcolour science
H
Haimeng Ren
Tencent Inc.
D
Donghua Jiang
Tencent Inc.
H
Haipeng Ming
Tencent Inc.
L
Lehua Ding
Tencent Inc.
Z
Zhonghan Lin
Tencent Inc.
S
Shengying Wei
Tencent Inc.
W
Wei Liu
Tencent Inc.
K
Kai Liu
Tencent Inc.
J
Jianchen Zhu
Tencent Inc.