Bookmarks

RDMA — remote direct memory access

A way for servers to exchange data in which the network card of one node reads and writes the memory of another directly, without the involvement of the CPU or the operating system kernel.

Also: remote memory access, remote memory access

checked 9 Nov

All terms

Ordinary network exchange — a chain of copies: data travels from application memory to kernel memory, from there to the network card’s buffer, and on the other node everything repeats in reverse. RDMA removes these copies: the network card places data straight into the buffer of the remote application. This gives low latency and a low load on the CPU — which is why RDMA became the foundation of AI cluster and storage networks.

How a transfer proceeds

The application registers its buffers with the network adapter in advance and receives access keys. In the request the sender specifies the virtual address and the key of the recipient’s buffer — and the adapter reads or writes memory directly from this, without kernel calls and without copies. The operations are defined in the RDMA specification (RFC 5040):

OperationWhat it does
Senddelivers a message into a buffer that the recipient has placed in its receive queue in advance — like an ordinary send, but without copies
Writewrites data into the memory of the remote side by address and key; the recipient takes no part in the transfer
Readreads the memory of the remote side: the initiator itself specifies where to take the data from

Where RDMA runs

TransportRuns overPeculiarities
InfiniBandits own switched networkRDMA is part of the architecture; standard by the InfiniBand Trade Association
RoCEEthernetRoCEv2 runs over UDP/IP (port 4791) and is routable; a lossless network is needed — PFC and ECN
iWARPTCPthe RFC 5040–5044 set; runs in an ordinary IP network

The idea came from specialised cluster fabrics — InfiniBand, Virtual Interface Architecture, — in which the adapter, under application control, directed data into buffers itself. For ordinary IP networks RDMA was standardised by the IETF: RFC 4297 in 2005 stated the problem, and in 2007 the iWARP series came out — RFC 5040–5044.

Why HPC and AI need it

Copying was long the main limitation of network input/output: in the measurements cited by RFC 4297, copying accounted for up to half the cost of TCP processing, and dropping the copies raised a web server’s throughput by tens of per cent.

In model training, GPUs exchange gradients and activations at every step. GPUDirect RDMA lets the network card read and write video memory directly over PCIe, bypassing CPU memory — the NCCL library relies on this and on RDMA transports such as InfiniBand Verbs when it assembles collective operations between nodes. Storage runs on RDMA too: NVMe over Fabrics delivers NVMe commands over a network at a speed close to a local disk.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • RoCERDMA over Ethernet

    RoCE is not a separate access method but the same RDMA packaged in Ethernet: the same operations over ordinary Ethernet networks.

  • IBInfiniBand

    InfiniBand is a network built entirely around RDMA; RDMA itself is broader: it also runs over Ethernet (RoCE) and over TCP (iWARP).

In depth in the references

where the topic is covered in detail