arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1701.01189cs.DC
收藏

GPU Multissplit:并行算法的扩展研究

GPU Multisplit: an extended study of a parallel algorithm

Saman Ashkiani, Andrew Davidson, Ulrich Meyer, John D. Owens

摘要:

Multissplit是一种非常有用的并行原语,它将其输入数据排列到连续的桶或箱中,其中将元素分类到桶中的函数由程序员提供。由于GPU上缺乏有效的多分割,程序员通常选择使用排序来实现多分割。一种方法是首先生成桶ID的辅助数组,然后基于它对输入数据进行排序。如果索引较小的桶具有较小值的键,则多分裂的另一种方法是直接对输入数据进行排序。这两种方法都是低效的,并且需要更多的工作:前者需要更昂贵的数据移动,而后者在每个桶中对元素进行排序时花费了不必要的努力。在这项工作中,我们提供了一个并行模型和多个实现的多分裂问题。我们主要关注的是少量(最多256个)桶的多分割。我们使用线程束同步编程模型,并强调线程束范围内的通信,以避免分支发散和减少内存使用。我们还对输入元素进行了分层重新排序,以更好地合并全局内存访问。在GeForce GTX 1080 GPU上,对于仅键(或键值)多拆分,我们可以达到18.93 Gkeys/s(或11.68 Gpairs/s)的峰值吞吐量。最后,我们演示了如何multisplit可以用作基数排序的构建块。在我们的基于多拆分的排序实现中,我们实现了与最快的GPU排序例程相当的性能,对32位键(和键值对)进行排序,吞吐量为3.0 G keys/s(和2.1 Gpair/s)。

英文摘要:

Multisplit is a broadly useful parallel primitive that permutes its input data into contiguous buckets or bins, where the function that categorizes an element into a bucket is provided by the programmer. Due to the lack of an efficient multisplit on GPUs, programmers often choose to implement multisplit with a sort. One way is to first generate an auxiliary array of bucket IDs and then sort input data based on it. In case smaller indexed buckets possess smaller valued keys, another way for multisplit is to directly sort input data. Both methods are inefficient and require more work than necessary: the former requires more expensive data movements while the latter spends unnecessary effort in sorting elements within each bucket. In this work, we provide a parallel model and multiple implementations for the multisplit problem. Our principal focus is multisplit for a small (up to 256) number of buckets. We use warp-synchronous programming models and emphasize warp-wide communications to avoid branch divergence and reduce memory usage. We also hierarchically reorder input elements to achieve better coalescing of global memory accesses. On a GeForce GTX 1080 GPU, we can reach a peak throughput of 18.93 Gkeys/s (or 11.68 Gpairs/s) for a key-only (or key-value) multisplit. Finally, we demonstrate how multisplit can be used as a building block for radix sort. In our multisplit-based sort implementation, we achieve comparable performance to the fastest GPU sort routines, sorting 32-bit keys (and key-value pairs) with a throughput of 3.0 G keys/s (and 2.1 Gpair/s).

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

↑