We consider the Top-$K$ selection problem, which aims to identify the largest $K$ elements in an array. Top-$K$ selection arises in many machine learning algorithms and often becomes a bottleneck on accelerators, which are optimized for dense matrix multiplications. To address this problem, Chern et al. (2022) proposed a fast two-stage approximate Top-$K$ algorithm that: (i) partitions the input array into equal-sized chunks and selects the top-$1$ element from each partition; and (ii) sorts the resulting smaller subset and returns the top $K$ elements. In this paper, we generalize the first stage so that each partition selects the top $K'$ elements (for $1 \leq K' \leq K$). Our contributions include: (i) an expression for the expected recall of this generalized algorithm under random partitioning, and a demonstration that choosing $K' > 1$ with fewer partitions in the first stage more effectively reduces the input size to the second stage while maintaining the same expected recall as the original algorithm; (ii) a bound on the expected recall of the original algorithm as a function of the algorithm parameters that is provably tighter by a factor of $2$ than the bound reported by Chern et al. (2022); and (iii) an implementation of our algorithm on Cloud TPUv5e that achieves approximately an order of magnitude speedup over the original algorithm without sacrificing recall.


翻译:我们考虑Top-K选择问题,其目标是在数组中找出最大的K个元素。Top-K选择出现在许多机器学习算法中,并且常成为加速器(针对密集型矩阵乘法进行了优化)上的性能瓶颈。为解决此问题,Chern等人(2022)提出了一种快速两阶段近似Top-K算法,该算法:(i)将输入数组划分为大小相等的块,并从每个分区中选择top-1元素;(ii)对生成的较小子集进行排序并返回前K个元素。本文对第一阶段进行泛化,使每个分区选择前K'个元素(其中1 ≤ K' ≤ K)。我们的贡献包括:(i)在随机分区下该泛化算法期望召回率的表达式,并证明在第一阶段选择K' > 1且使用更少分区时,能在保持与原算法相同期望召回率的同时更有效地减小第二阶段输入规模;(ii)给出原算法期望召回率作为算法参数的函数表达式,其边界被证明比Chern等人(2022)报告的边界严格2倍;(iii)在Cloud TPUv5e上实现我们的算法,在不牺牲召回率的情况下实现约一个数量级的加速比。

0
下载
关闭预览

相关内容

在数学和计算机科学之中,算法(Algorithm)为一个计算的具体步骤,常用于计算、数据处理和自动推理。精确而言,算法是一个表示为有限长列表的有效方法。算法应包含清晰定义的指令用于计算函数。 来自维基百科: 算法
【博士论文】基于冲量的加速优化算法
专知会员服务
28+阅读 · 2021年11月29日
机器学习中的最优化算法总结
人工智能前沿讲习班
22+阅读 · 2019年3月22日
最新|深度离散哈希算法,可用于图像检索!
全球人工智能
14+阅读 · 2017年12月15日
从浅层模型到深度模型:概览机器学习优化算法
机器之心
27+阅读 · 2017年7月9日
各种相似性度量及Python实现
机器学习算法与Python学习
11+阅读 · 2017年7月6日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月14日
VIP会员
最新内容
综述 | 从问答到任务完成:Agent系统与Harness设计
专知会员服务
1+阅读 · 今天16:54
Agentic RL:框架、实践与长程智能体训练
专知会员服务
1+阅读 · 今天16:52
重新思考无人机时代的生存能力
专知会员服务
5+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
4+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
4+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
4+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
6+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关VIP内容
【博士论文】基于冲量的加速优化算法
专知会员服务
28+阅读 · 2021年11月29日
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员