Abstract
Applications often communicate data that is non-contiguous in the send- or the receive-buffer, e.g., when exchanging a column of a matrix stored in row-major order. While non-contiguous transfers are well supported in HPC (e.g., MPI derived datatypes), they can still be up to 5x slower than contiguous transfers of the same size. As we enter the era of network acceleration, we need to investigate which tasks to offload to the NIC: In this work we argue that non-contiguous memory transfers can be transparently network-accelerated, truly achieving zero-copy communications. We implement and extend sPIN, a packet streaming processor, within a Portals 4 NIC SST model, and evaluate strategies for NIC-offloaded processing of MPI datatypes, ranging from datatype-specific handlers to general solutions for any MPI datatype. We demonstrate up to 10x speedup in the unpack throughput of real applications, demonstrating that non-contiguous memory transfers are a first-class candidate for network acceleration.
The Bottleneck of Non-Contiguous Data
In distributed High-Performance Computing (HPC), data is rarely stored in a perfectly contiguous block. Whether it is a single column of a row-major matrix or complex irregular graph structures, applications frequently need to share "scattered" data. Traditionally, this requires a two-step process: the sender's CPU "packs" these pieces into a contiguous buffer, and the receiver's CPU "unpacks" them into their final memory locations.
This packing/unpacking cycle is a major performance bottleneck. It consumes valuable CPU cycles, pollutes caches, and creates unnecessary traffic on the memory bus and PCIe lanes. While Remote Direct Memory Access (RDMA) can bypass the CPU for contiguous data, standard hardware solutions like scatter-gather lists struggle to scale with the high fragmentation found in complex MPI Derived Datatypes.
Offloading to the Network with sPIN
To address this, the authors propose offloading the unpacking process directly to the Network Interface Card (NIC) using the Streaming Processing in the Network (sPIN) programming model. By running lightweight "handlers" on the NIC, data can be processed on-the-fly as packets stream in from the network, enabling true zero-copy communication.
As shown in the architecture above, the system utilizes multiple Handler Processing Units (HPUs) to handle high line rates (up to 200 Gbps). To manage the state of complex datatypes across parallel packets without expensive hardware locks, the authors developed a Progressing Checkpoints (RW-CP) strategy. This approach uses a round-robin scheduler to assign packet sequences to specific virtual cores, ensuring lock-free, high-concurrency processing.
Achieving True Zero-Copy Communication
The primary advantage of the sPIN approach is the reduction of host-side overhead. In a traditional setup, data must travel from the NIC to main memory, then to the CPU for unpacking, and finally back to its destination in memory. With sPIN, the NIC understands the data layout and writes it directly to its final destination.
Key Results and Impact
The evaluation, conducted using a hardware prototype based on the PULP RISC-V architecture, reveals significant performance gains across various scientific domains (including weather prediction, fluid dynamics, and molecular dynamics):
- Throughput: Offloaded unpacking achieved a 10x to 12x speedup in throughput compared to host-CPU processing.
- Efficiency: Host memory traffic was reduced by 3.8x, freeing up bandwidth for other application tasks.
- Application Performance: In a simulated 2D Fast Fourier Transform (FFT2D) on 64 nodes, offloading the matrix transposition resulted in a 26% total application speedup.
Conclusion
By making the NIC "smart" enough to handle complex data layouts, the sPIN model transforms non-contiguous memory transfers from a bottleneck into an accelerated first-class operation. The proposed 32-core RISC-V accelerator fits within the power and area budgets of modern SmartNICs, proving that network-accelerated unpacking is both feasible and highly effective for next-generation HPC systems.
Summary updated