arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2205.05982cs.IRcs.DC
收藏

矢量化和性能可移植的快速排序

Vectorized and performance-portable Quicksort

Mark Blacher, Joachim Giesen, Peter Sanders, Jan Wassenberg

摘要:

最近的工作表明,使用向量CPU指令的快速排序的实现可以在广泛使用的非向量化算法。然而,这些实现通常是单线程的,针对特定的指令集实现,并且限于一小组键类型。我们解除了这三个限制:我们提出的“vqsort”算法集成到最先进的并行排序器“ips 4 o”中,几何平均加速比为1.59。相同的实现在四个平台上的七个指令集(包括SVE和RISC-VV)上工作。它还支持浮点和16-128位整数键。据我们所知,这是CPU上最快的非元组键排序,比标准库中实现的排序算法快20倍。本文重点介绍了实际的工程方面,使速度和可移植性,我们还没有看到一个快速排序实现证明。此外,我们还引入了紧凑和无转置的排序网络,用于小数组的寄存器内排序,以及一种对对抗性输入具有鲁棒性的向量友好枢轴采样策略。

英文摘要:

Recent works showed that implementations of Quicksort using vector CPU instructions can outperform the non-vectorized algorithms in widespread use. However, these implementations are typically single-threaded, implemented for a particular instruction set, and restricted to a small set of key types. We lift these three restrictions: our proposed 'vqsort' algorithm integrates into the state-of-the-art parallel sorter 'ips4o', with a geometric mean speedup of 1.59. The same implementation works on seven instruction sets (including SVE and RISC-V V) across four platforms. It also supports floating-point and 16-128 bit integer keys. To the best of our knowledge, this is the fastest sort for non-tuple keys on CPUs, up to 20 times as fast as the sorting algorithms implemented in standard libraries. This paper focuses on the practical engineering aspects enabling the speed and portability, which we have not yet seen demonstrated for a Quicksort implementation. Furthermore, we introduce compact and transpose-free sorting networks for in-register sorting of small arrays, and a vector-friendly pivot sampling strategy that is robust against adversarial input.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑