Fast Shared-Memory Barrier Synchronization for a 1024-Cores RISC-V Many-Core Cluster

Marco Bertuletti, Samuel Riedel, Yichao Zhang, Alessandro Vanelli-Coralli, Luca Benini

Introduction

In the pursuit of extreme parallelism, the TeraPool architecture represents a significant milestone: a massive many-core system featuring 1024 RISC-V cores sharing a tightly coupled 4MB L1 memory. However, as core counts scale, traditional synchronization primitives often become performance bottlenecks. This paper addresses the challenge of implementing efficient barrier synchronization—a critical point in parallel programs where all processors must wait for one another—at a scale where standard software methods typically fail due to memory contention and notification latency.

The Synchronization Challenge at Scale

Barrier synchronization in a many-core environment faces two primary hurdles:

  1. Interconnect Contention: When 1024 cores simultaneously attempt to update a single arrival counter in shared memory, the resulting traffic saturates the interconnect, leading to exponential increases in latency.
  2. Notification Latency: Once the final core reaches the barrier, notifying the remaining 1023 cores to resume execution via software-only methods is slow and energy-inefficient, often scaling linearly ($O(N)$) with the number of cores.

While these issues are manageable in smaller clusters (8–64 cores), the TeraPool's 1024-core density requires a fundamental rethink of how synchronization is handled to prevent it from becoming a "performance killer."

Proposed Methodology

The researchers implemented a hybrid hardware-software approach to optimize the barrier kernel for the TeraPool architecture:

Hierarchical $k$-ary Tree Barriers

To mitigate memory contention, the researchers replaced the centralized counter with a $k$-ary tree structure. In this model, cores are organized into groups; small subsets synchronize locally, and only the "winner" of each group proceeds to the next level of the hierarchy. This distributes the atomic operations across the memory space and reduces the pressure on any single memory bank.

Hardware-Assisted Wakeup Logic

To solve the notification bottleneck, a dedicated hardware unit was integrated into the cluster. This unit features memory-mapped registers that, when triggered by the final arriving core, send hardwired signals to instantly wake up sleeping cores. This reduces the notification phase to near-constant time, regardless of the core count.

Selective and Flexible Synchronization

The hardware supports granular synchronization, allowing the system to wake up specific subsets of the cluster—ranging from individual cores to "Tiles" of 8 or "Groups" of 128. This flexibility is essential for complex workloads where only a portion of the machine may need to synchronize at a given time.

Experimental Evaluation

The architecture was evaluated using a mix of synthetic and real-world benchmarks:

  • Synthetic Kernels: Used to simulate various levels of workload imbalance and arrival patterns.
  • Parallel Signal Processing: Standard blocks such as MATMUL, Conv2D, and DCT were used to measure overhead in common computational tasks.
  • 5G Physical Layer (PHY) Uplink: A realistic application involving OFDM demodulation and digital beamforming was used to test the system under production-level stress.

Key Insights: The "Scoop" vs. "Staircase" Effect

A critical finding of the study is that the optimal barrier strategy depends on the "scatter" of core arrival times.

  • Low Scatter (The Scoop): If all cores arrive at the barrier nearly simultaneously, high-radix trees or central counters perform poorly due to massive contention. In this scenario, a distributed tree is essential.
  • High Scatter (The Staircase): If cores arrive at widely different times, the requests are naturally spread out. In these cases, the overhead of managing a complex tree structure can actually make it slower than a simple central counter.

This insight led to the development of a tunable software API, allowing programmers to adjust the "radix" (the $k$ in the $k$-ary tree) to match the specific characteristics of their workload.

Results and Impact

The optimized synchronization stack achieved significant performance gains:

  • 1.6× Speedup: Compared to naive central-counter barriers, the tree-based approach with hardware wakeup significantly improved throughput.
  • Minimal Overhead: For kernels fitting within the 4MB L1 memory, synchronization overhead remained below 10%.
  • 5G Efficiency: In the 5G PHY uplink test case, which utilized 4096-point FFTs, the synchronization overhead was restricted to just 6.2% of total runtime.

Conclusion

This work demonstrates the first successful implementation of shared-memory barriers for a 1024-core cluster with a single shared data memory. By combining hierarchical software algorithms with dedicated hardware triggers, the researchers proved that massive many-core systems can maintain high efficiency even during frequent synchronization. Future work will focus on scaling these techniques to 4096+ cores and exploring how these fast barriers can support more dynamic, task-based programming models.

Summary updated

BibTeX
@inproceedings{bertuletti2023fast,
  author = {Marco Bertuletti and Samuel Riedel and Yichao Zhang and Alessandro Vanelli-Coralli and Luca Benini},
  title = {{Fast Shared-Memory Barrier Synchronization for a 1024-Cores RISC-V Many-Core Cluster}},
  booktitle = {SAMOS},
  year = {2023},
  doi = {10.1007/978-3-031-46077-7\_16},
}
Figure