RDMA vs. RPC for Implementing Distributed Data Structures

Benjamin Brock, Yuxin Chen, Jiakun Yan, John D. Owens, Aydin Buluç, Katherine A. Yelick · DOI

Introduction

High-performance computing (HPC) applications often rely on distributed data structures like hash tables and queues to share data across thousands of nodes. Developers typically choose between two communication paradigms: one-sided RDMA (Remote Direct Memory Access) and two-sided RPC (Remote Procedure Call). While RDMA is known for low latency by bypassing the target CPU, RPC offers greater expressivity by executing logic directly on the target node. This paper quantifies the trade-offs between these styles, particularly for irregular applications with unpredictable access patterns.

Methodology

The researchers compared RDMA-based implementations using the Berkeley Container Library (BCL) against RPC-based versions (Active Messages) using the GASNet-EX framework. They developed an analytical cost model to decompose complex operations into primitive components, such as put, get, and atomic compare-and-swap. Benchmarks were conducted on the Cori supercomputer (a Cray XC40) to measure raw component latency and full data structure performance across up to 128 nodes.

The Attentiveness Penalty

A critical finding of the study is the "attentiveness" penalty associated with RPC. Because RPCs require the target CPU to process requests, latency increases significantly if the target is busy with local computation. In contrast, RDMA operations are handled by the Network Interface Card (NIC) hardware, maintaining relatively constant latency regardless of CPU load.

Latency of queue insertion as a function of remote compute time, illustrating the attentiveness penalty for RPC-based methods.

As illustrated in the figure above, RPC latency (AM Queue Insertion) grows linearly as the remote compute time increases, whereas RDMA remains stable. However, RPCs can be more efficient in terms of network round-trips; a complex operation might require multiple RDMA calls to ensure atomicity, while a single RPC can handle the logic on the target node.

Key Results

The study found that RDMA-based "Find" operations in hash tables significantly outperform RPC versions due to lower raw overhead. For "Insert" operations, however, the performance gap narrows. This is because RDMA requires more complex coordination and multiple round-trips to ensure thread safety in a concurrent environment.

Latency of hash table operations across varying node counts, comparing RDMA and Active Message (RPC) implementations.

The analytical model proved highly effective at predicting which communication style would be faster for specific scenarios. While raw RDMA put latency was measured at approximately 3.0 μs compared to 8.0 μs for RPC (Active Messages), the "smart" nature of RPCs can offset this raw speed advantage in multi-step operations or high-contention scenarios.

Conclusion and Future Work

The choice between RDMA and RPC depends heavily on the "attentiveness" of the remote CPU and the complexity of the operation. While RDMA offers superior raw performance and resilience to CPU load, RPC's expressivity can reduce network overhead for complex logic. The authors suggest that their cost model can guide hardware architects in designing new RDMA primitives, such as indirect memory access, to further bridge the gap between these two paradigms. Future work will involve extending the model to account for high-network-congestion environments and different interconnect hardwares like InfiniBand.

Summary updated

Abstract

Distributed data structures are key to implementing scalable applications for scientific simulations and data analysis. In this paper we look at two implementation styles for distributed data structures: remote direct memory access (RDMA) and remote procedure call (RPC). We focus on operations that require individual accesses to remote portions of a distributed data structure, e.g., accessing a hash table bucket or distributed queue, rather than global operations in which all processors collectively exchange information. We look at the trade-offs between the two styles through microbenchmarks and a performance model that approximates the cost of each. The RDMA operations have direct hardware support in the network and therefore lower latency and overhead, while the RPC operations are more expressive but higher cost and can suffer from lack of attentiveness from the remote side. We also run experiments to compare the real-world performance of RDMA- and RPC-based data structure operations with the predicted performance to evaluate the accuracy of our model, and show that while the model does not always precisely predict running time, it allows us to choose the best implementation in the examples shown. We believe this analysis will assist developers in designing data structures that will perform well on current network architectures, as well as network architects in providing better support for this class of distributed data structures.
BibTeX
@inproceedings{brock2019rdma,
  author = {Benjamin Brock and Yuxin Chen and Jiakun Yan and John D. Owens and Aydin Buluç and Katherine A. Yelick},
  title = {{RDMA vs. RPC for Implementing Distributed Data Structures}},
  booktitle = {IA3@SC},
  year = {2019},
  doi = {10.1109/ia349570.2019.00009},
}
Figure