HackerPapers

arXiv:1110.4623cs.OS

Efficient Synchronization Primitives for GPUs

Jeff A. Stuart, John D. Owens

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

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.

arXiv comments
13 pages with appendix, several figures, plans to submit to CompSci conference in early 2012
Journal reference
DOI
Subjects
cs.OSOperating Systems cs.DCDistributed, Parallel, and Cluster Computing cs.DSData Structures and Algorithms cs.GRGraphics

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from May 2018 to May 2018.

Comments linking this paper, per year.

Discussed in comments1 thread

  1. C Is Not a Low-Level Language 1 comment
    • Rant time. > "Legacy" code in this context is code that was written in the past and is not going to be updated or rewritten. In that case, I would not say Legacy code is sequential. For the past few decades, SMP has been the target where sensible/possible. > At a fine-grained…

      arghwhatView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.