GPU的高效同步原语
Efficient Synchronization Primitives for GPUs
摘要:
在本文中,我们将重新审视同步原语的设计-特别是屏障、互斥和信号量-以及它们如何应用于GPU。由于GPU和CPU的硬件和编程模型的差异,以前的实现是不够的。我们在CUDA中创建了新的实现,并通过在两种最常用的GPU(NVIDIA的Tesla和Fermi级GPU)上运行一组内存系统基准测试,分析了GPU上的旋转性能以及GPU上的休眠方法。从我们的研究结果,我们定义了更高层次的原则,是有效的通用众核处理器,其中最重要的是限制同步操作所需的原子访问的数量,因为原子访问比常规的内存访问慢。我们使用基准测试的结果来批判现有的同步算法并指导我们的新实现,然后定义GPU的抽象,以根据内存系统的行为对任何GPU进行分类。我们使用这种抽象来创建适当的实现的原语专门针对GPU,并分析这些算法的性能特斯拉和费米。然后,我们根据抽象的特征预测未来GPU的性能。我们还研究了自旋等待和睡眠等待在每个原语中的作用,以及它们的性能如何根据机器抽象而变化,然后根据GPU的特性和预期的争用给出了一组指导方针。
英文摘要:
In this paper, we revisit the design of synchronization primitives---specifically barriers, mutexes, and semaphores---and how they apply to the GPU. Previous implementations are insufficient due to the discrepancies in hardware and programming model of the GPU and CPU. We create new implementations in CUDA and analyze the performance of spinning on the GPU, as well as a method of sleeping on the GPU, by running a set of memory-system benchmarks on two of the most common GPUs in use, the Tesla- and Fermi-class GPUs from NVIDIA. From our results we define higher-level principles that are valid for generic many-core processors, the most important of which is to limit the number of atomic accesses required for a synchronization operation because atomic accesses are slower than regular memory accesses. We use the results of the benchmarks to critique existing synchronization algorithms and guide our new implementations, and then define an abstraction of GPUs to classify any GPU based on the behavior of the memory system. We use this abstraction to create suitable implementations of the primitives specifically targeting the GPU, and analyze the performance of these algorithms on Tesla and Fermi. We then predict performance on future GPUs based on characteristics of the abstraction. We also examine the roles of spin waiting and sleep waiting in each primitive and how their performance varies based on the machine abstraction, then give a set of guidelines for when each strategy is useful based on the characteristics of the GPU and expected contention.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。