Abstract
In this work, we describe a new, practical approach to integrating hardware-based data compression within the memory hierarchy, including on-chip caches, main memory, and both on-chip and off-chip interconnects. This approach is fast, simple, and effective in saving storage space. A key insight is that access time—specifically decompression latency—is critical in modern memory hierarchies. By combining inexpensive hardware support with modest OS support, our holistic approach to compression achieves substantial improvements in performance and energy efficiency. We introduce three major contributions: Base-Delta-Immediate Compression (BDI) for low-latency cache compression, the Size-based Insertion Policy (SIP) for compression-aware cache management, and Linearly Compressed Pages (LCP) for efficient main memory compression.
Introduction: The Memory Wall and the Latency Penalty
Modern data-intensive applications are increasingly hitting the "memory wall." While processor speeds have historically scaled rapidly, the capacity and bandwidth of caches and main memory (DRAM) have struggled to keep pace. This creates a bottleneck where high-performance cores are frequently starved for data.
Data compression is a logical solution to increase effective capacity and bandwidth without physical hardware expansion. However, traditional software-based compression algorithms (like Lempel-Ziv or gzip) are impractical for memory hierarchies. Memory accesses are random and highly sensitive to latency; if a CPU must wait dozens of cycles to decompress a cache line, the performance penalty quickly outweighs any capacity benefits. Furthermore, storing variable-sized compressed blocks in main memory introduces significant complexity in address translation. This research addresses these challenges by prioritizing hardware simplicity and ultra-low decompression latency over maximum compression ratios.
Methods: A Holistic Compression Framework
1. Base-Delta-Immediate (BΔI) Compression
BΔI is designed for on-chip caches where speed is paramount. It exploits the "low dynamic range" of data—the observation that values within a single cache line are often numerically close to one another (e.g., an array of pointers or small integers). BΔI stores a single base value and an array of small differences (deltas). This architecture allows for parallel, 1-cycle decompression using simple vector addition, making it nearly invisible to the processor's critical path.
2. Compression-Aware Management Policies (CAMP)
Standard cache policies are "size-oblivious," treating all blocks as equal. CAMP introduces policies that account for compressed size:
- Minimal-Value Eviction (MVE): Weighs a block's locality against its compressed size when making eviction decisions.
- Size-based Insertion Policy (SIP): Uses the compressed size of a block as a signature to predict future reuse. The insight here is that specific data structures often have distinct compressed sizes and access patterns.
3. Linearly Compressed Pages (LCP)
LCP solves the address translation nightmare in main memory. Instead of packing variable-sized blocks end-to-end, LCP compresses all lines in a page to a fixed target size (e.g., 16 bytes). Lines that cannot meet this compression target are stored in a separate "exception" area. This allows the memory controller to locate any compressed line using simple linear scaling (math) rather than complex metadata lookups.
4. Toggle-Aware Compression
Compression typically increases data entropy, which can lead to more frequent bit-flipping on physical wires. This "bit toggling" increases dynamic energy consumption. We introduce an Energy Control (EC) mechanism for interconnects that dynamically disables compression if the energy penalty of bit toggling exceeds the performance benefits of saved bandwidth.
Evaluation and Results
The proposed framework was evaluated using cycle-accurate simulations across SPEC CPU2006, database queries (TPC-H/TPC-C), and extensive GPU workloads.
- Cache Performance: BΔI achieved an average compression ratio of 1.53x with 1-cycle latency, improving multi-core performance by up to 11.2%. This effectively provides the performance of a cache twice its physical size.
- Main Memory Capacity: LCP increased effective main memory capacity by 69% on average and reduced page faults by 23%.
- Energy Efficiency: The Toggle-Aware Energy Control mechanism reduced DRAM energy by 8.3% on average by mitigating the bit-toggle penalty, with negligible impact on performance.
Key Insights
- Latency > Ratio: In memory hierarchies, a modest compression ratio is acceptable if it enables single-cycle decompression.
- Size as a Signature: The compressed size of a block is a reliable indicator of its underlying data structure, which can be leveraged to improve cache replacement logic.
- Linear Mapping: Fixed-size slots within compressed pages are the key to making main memory compression computationally feasible without heavy hardware overhead.
Limitations and Future Directions
BΔI's effectiveness can be limited when data structures mix disparate types (e.g., a 64-bit pointer next to an 8-bit boolean), which disrupts the low dynamic range. Future work includes "compiler-assisted data compression," where the compiler reorganizes data layouts to maximize hardware compressibility. Additionally, extending these techniques to non-volatile memories (NVMs) like PCM or STT-MRAM presents a promising avenue for further capacity and energy gains.
Summary updated