Abstract
This paper investigates hardware-based memory compression designs to increase memory bandwidth. When lines are compressible, the hardware can store multiple lines in a single memory location and retrieve them in a single access, thereby increasing effective bandwidth. However, packing multiple lines together based on compressibility causes a line to have multiple possible locations, typically requiring metadata to specify the line's state. Unfortunately, accessing this metadata incurs significant bandwidth overheads, degrading performance by as much as 40%. Ideally, we want to implement memory compression while eliminating these overheads. This paper proposes CRAM, a bandwidth-efficient, entirely hardware-based design that requires no OS support or changes to memory modules. CRAM uses a novel implicit-metadata mechanism, where compressibility is determined by scanning for a special marker word. Equipped with a low-cost Line Location Predictor (LLP) with 98% accuracy and a dynamic enabling scheme, CRAM provides a speedup of up to 73% (average 6%) without performance degradation for any workload.
TL;DR
CRAM is a hardware-only memory compression scheme designed to boost system bandwidth without requiring Operating System (OS) support or specialized memory modules. By using "implicit metadata" embedded within data lines and a high-accuracy location predictor, CRAM eliminates the performance-sapping overhead of traditional metadata lookups, delivering an average speedup of 6% (up to 73%) with negligible storage costs.
What Problem Does This Paper Address?
As we pack more cores onto processors, memory bandwidth—the speed at which data moves between the CPU and RAM—has become a critical bottleneck. Data compression is a natural solution: if you can shrink data, you can fit more of it into a single transfer.
However, existing memory compression faces a "metadata tax." To know if a piece of data is compressed and where it is located, the memory controller usually has to consult a metadata table. Fetching this metadata requires extra memory accesses, which can consume so much bandwidth that they actually slow the system down by as much as 40%.
Furthermore, most designs require the OS to manage the "variable" memory capacity that compression creates, making them difficult to implement in standard hardware. CRAM seeks to provide the bandwidth benefits of compression as a "drop-in" hardware fix with zero metadata-fetch overhead and no OS involvement.
Methods
The authors introduce three novel components to make CRAM work:
- Implicit Metadata (The Marker): Instead of a separate table, CRAM reserves the last 4 bytes of a 64-byte memory line for a "marker" word. If these bytes match a specific pattern, the controller knows the line is compressed (either 2-to-1 or 4-to-1). If they don't match, it's treated as standard uncompressed data.
- Line Location Predictor (LLP): When lines are compressed, they are "packed" together. For example, in a 2:1 compression scheme, Line B might be stored at Line A's address. This creates multiple possible locations for any given line.
To avoid guessing where a line is, CRAM uses a small Last Compressibility Table (LCT). Because lines in the same memory page usually have similar compressibility, the LLP can predict a line's location with 98% accuracy.
- Dynamic-CRAM: Compression isn't always a win. Compressing "clean" data before writing it back to memory adds overhead. CRAM uses set-sampling (monitoring 1% of cache sets) and a saturating counter to perform a real-time cost-benefit analysis. If compression is hurting performance for a specific workload, CRAM dynamically disables it to ensure "do no harm" semantics.
To handle the rare case where uncompressed data accidentally looks like a marker (a "collision"), CRAM simply inverts the data and tracks the address in a tiny 16-entry Line Inversion Table (LIT).
Datasets
The researchers evaluated CRAM using the USIMM x86 memory simulator across a diverse set of 27 memory-intensive workloads:
- SPEC CPU 2006 & 2017: Standard benchmarks for general-purpose computing.
- GAP Benchmark Suite: Graph analytics workloads (e.g., social network graphs) which are notoriously difficult for memory systems due to poor spatial locality.
- Mixed Workloads: Combinations of different SPEC benchmarks running simultaneously to simulate multi-core environments.
Key Insights and Ideas
- The Metadata Paradox: The bandwidth saved by compression is often smaller than the bandwidth wasted fetching metadata. CRAM’s "implicit" approach bypasses this paradox entirely.
- The 60-Byte Sweet Spot: By analyzing data patterns, the authors found that most pairs of lines that can compress to 64 bytes can actually fit into 60 bytes. Sacrificing 4 bytes for a marker has a negligible impact on the compression ratio but a massive impact on access latency.
- Exploiting Spatial Homogeneity: The high accuracy of the LLP (98%) stems from the observation that if one part of a data structure is compressible, the neighboring parts likely are too.
- Hardware-Only Simplicity: By keeping memory capacity constant, CRAM avoids complex OS-level memory management, making it a viable candidate for actual processor integration.
Key Results
- Performance: CRAM achieved an average speedup of 6%, with some workloads seeing gains as high as 73%.
- Bandwidth: It improved effective memory bandwidth by an average of 9%.
- Robustness: Thanks to the Dynamic-CRAM logic, the system never performed worse than a standard uncompressed system, even on "uncompressible" graph workloads.
- Efficiency: The entire logic requires less than 300 bytes of storage at the memory controller, making it incredibly "cheap" in terms of silicon real estate.
Limitations and Future Work
- Fixed Capacity: CRAM is strictly a bandwidth enhancer. It does not increase the total amount of data you can store in RAM (capacity).
- Marker Collisions: While statistically rare (less than 1 in a billion), collisions require an extra access to the Line Inversion Table.
- Ganged Evictions: To simplify hardware, CRAM evicts all lines in a compressed group at once. While the impact on cache hit rates is noted as negligible, it remains a constraint.
- Future Directions: The authors suggest combining CRAM's implicit metadata with capacity-focused designs if OS-level mapping can be handled without losing low-latency benefits.
Summary updated