Abstract
Distributed deep learning and scientific computing rely heavily on the allreduce operation to aggregate data across multiple nodes. Traditional host-based or fixed-function in-network solutions often face a trade-off between performance and flexibility. This paper presents Flare, a novel in-network computing framework that offloads allreduce to programmable switches using a RISC-V-based architecture called PsPIN. Flare supports custom data types, floating-point arithmetic, and sparse data, achieving up to a 43% speedup over state-of-the-art solutions while maintaining line-rate performance.
Introduction
In distributed computing, the allreduce operation is a critical collective communication pattern where multiple hosts combine their local data (e.g., gradients during AI training) and share the global result. Traditionally, this operation is performed on host CPUs, consuming significant processing cycles and generating substantial network traffic.
In-network allreduce attempts to mitigate these issues by performing the mathematical reduction within network switches as packets traverse the fabric. However, existing solutions suffer from a "Goldilocks" problem: fixed-function switches (e.g., Mellanox SHARP) are high-performance but rigid, while P4-programmable switches (e.g., Tofino) offer flexibility but lack essential features like floating-point units (FPUs) and complex memory access capabilities. Flare bridges this gap by providing a fully programmable, high-performance architecture for complex mathematical reductions.
Architecture and Methods
The core of Flare is the PsPIN architecture, a multi-cluster RISC-V processing unit integrated directly into the switch pipeline. Unlike traditional "match-action" tables, Flare utilizes "handlers"—small C functions executed on RISC-V cores (HPUs) for every incoming packet.
Aggregation Strategies
Flare introduces three distinct algorithms to organize mathematical operations within the switch:
- Single Buffer: Aggregates packets into a single memory location. While simple, it can lead to contention when multiple cores attempt simultaneous writes.
- Multiple Buffers: Increases parallelism by utilizing several memory spots.
- Tree Aggregation: Organizes the reduction in a hierarchical structure within the switch. This method is robust for small messages and ensures reproducibility, guaranteeing that floating-point sums remain bit-for-bit identical regardless of packet arrival order.
Sparse Data Support
Flare natively handles sparse vectors—data containing mostly zeros—by using hash tables at the "leaf" switches to store only non-zero elements. This significantly reduces the volume of data transmitted across the network. As data is aggregated up the network tree, Flare performs "densification," transitioning from hash tables to efficient arrays at the root switch.
Evaluation and Key Results
The researchers evaluated Flare using a cycle-accurate PsPIN simulator for hardware-level performance and the Structural Simulation Toolkit (SST) for 64-node "fat-tree" network simulations. Real-world gradient data from ResNet-50 training was used to benchmark sparse allreduce capabilities.
- Floating Point and Bandwidth: Flare natively supports FP32 and FP16 math, essential for modern AI. It matches or exceeds the performance of fixed-function hardware (SHARP) and P4 switches (SwitchML), achieving multi-Terabit-per-second throughput.
- Sparse Advantage: In 64-node ResNet-50 simulations, Flare's sparse allreduce provided a 35% performance improvement and a 20x reduction in network traffic compared to the best host-based sparse communication methods (SparCML).
- Efficiency: Compared to dense in-network allreduce, Flare’s sparse approach improved overall performance by 43% and reduced traffic by 13x.
Conclusion
Flare demonstrates that high-performance in-network computing can be achieved without sacrificing programmability. By integrating RISC-V cores into the switch architecture, Flare enables complex mathematical reductions and efficient handling of sparse data. While current implementations focus on FP16/FP32, future work aims to support FP64 precision and optimize hardware for indirect memory accesses to further enhance sparse data processing.
Summary updated