Automatic HBM Management: Models and Algorithms

Daniel DeLayo, Kenny Zhang, Kunal Agrawal, Michael A. Bender, Jonathan W. Berry, Rathish Das, Benjamin Moseley, Cynthia A. Phillips

Introduction

Modern high-performance computing systems increasingly rely on High-Bandwidth Memory (HBM) to bridge the performance gap between processor speeds and traditional DRAM. While HBM offers significantly higher throughput, its capacity remains limited. To simplify programming, systems often attempt to manage HBM as a transparent cache. However, this paper identifies a fundamental flaw in the standard hardware approach: the First-In-First-Out (FIFO) scheduling policy used to manage data movement between HBM and main memory.

Under high thread contention, FIFO can lead to severe performance degradation. The authors propose Dynamic Priority, a novel scheduling algorithm that shuffles thread priorities to achieve significant speedups while maintaining fairness and theoretical performance guarantees.

The HBM+DRAM Model

To analyze this problem, the researchers formalized an HBM+DRAM model that accounts for $p$ processor cores competing for $q$ narrow channels to main memory. In this architecture, HBM acts as a fast but small buffer, while the "far-channel" to DRAM represents the primary bottleneck.

The HBM model illustrates $p$ cores competing for $q$ limited channels to main memory, where $q \ll p$.

When multiple cores experience HBM cache misses simultaneously, they must queue for access to the DRAM channels. Current hardware typically uses FIFO to manage this queue. Theoretical analysis suggests that FIFO is "provably bad" because it spreads memory resources too thin, potentially causing "thrashing" where no single process has enough data to make meaningful progress.

Scheduling Policies

The study evaluates three primary scheduling strategies:

  1. FIFO: The industry standard, which serves requests in the order they arrive.
  2. Priority: A static scheme where specific threads are given consistent precedence. While theoretically efficient for minimizing total execution time (makespan), it is inherently unfair to low-priority threads.
  3. Dynamic Priority: The authors' proposed innovation. This approach leverages the efficiency of the Priority scheme but periodically shuffles the thread hierarchy. This randomization prevents starvation and ensures that all threads eventually make progress.

Experimental Results

The researchers validated their model using a custom C++ simulator against three workloads: GNU Sort, Sparse Matrix-Matrix Multiplication (SpGEMM), and a synthetic "Killer Trace" designed to trigger FIFO's worst-case behavior.

Performance Gains in Sparse Matrix Multiplication

The simulations revealed that at high thread counts, the Priority-based schemes significantly outperform FIFO. For memory-bound tasks like SpGEMM, the Priority scheme achieved up to a 3.3x speedup over FIFO as contention increased.

Performance comparison for Sparse Matrix-Matrix Multiplication. As thread count increases, the Priority scheme significantly outperforms FIFO, reaching a speedup of over 3x.

The "Killer Trace" and Dynamic Priority

On the synthetic trace—which repeatedly requests more unique pages than the HBM can hold—FIFO's performance collapsed, with execution times up to 40x longer than the Priority scheme.

Crucially, while static Priority can sometimes perform worse than FIFO at very low thread counts (due to unnecessary idling of resources), Dynamic Priority mitigates this disadvantage. By introducing randomization, the system achieves the high-performance ceiling of priority scheduling while remaining robust across the entire spectrum of thread counts.

Conclusion

This research demonstrates that the fairness of FIFO is a liability in high-contention HBM management. By prioritizing certain threads—and rotating those priorities over time—systems can avoid resource thrashing and dramatically improve throughput. Future work will involve cycle-accurate simulations and exploring the impact of shared data access patterns among cores to further refine these priority-cycling controllers for next-generation hardware.

Summary updated

BibTeX
@inproceedings{delayo2022automatic,
  author = {Daniel DeLayo and Kenny Zhang and Kunal Agrawal and Michael A. Bender and Jonathan W. Berry and Rathish Das and Benjamin Moseley and Cynthia A. Phillips},
  title = {{Automatic HBM Management: Models and Algorithms}},
  booktitle = {SPAA},
  year = {2022},
  doi = {10.1145/3490148.3538570},
}
Figure