English

Approximate Top-$k$ for Increased Parallelism

Machine Learning 2024-12-06 v1

Abstract

We present an evaluation of bucketed approximate top-kk algorithms. Computing top-kk exactly suffers from limited parallelism, because the kk largest values must be aggregated along the vector, thus is not well suited to computation on highly-parallel machine learning accelerators. By relaxing the requirement that the top-kk is exact, bucketed algorithms can dramatically increase the parallelism available by independently computing many smaller top-kk operations. We explore the design choices of this class of algorithms using both theoretical analysis and empirical evaluation on downstream tasks. Our motivating examples are sparsity algorithms for language models, which often use top-kk to select the most important parameters or activations. We also release a fast bucketed top-kk implementation for PyTorch.

Keywords

Cite

@article{arxiv.2412.04358,
  title  = {Approximate Top-$k$ for Increased Parallelism},
  author = {Oscar Key and Luka Ribar and Alberto Cattaneo and Luke Hudlass-Galley and Douglas Orr},
  journal= {arXiv preprint arXiv:2412.04358},
  year   = {2024}
}
R2 v1 2026-06-28T20:24:32.106Z