ICGMM: CXL-enabled Memory Expansion with Intelligent Caching Using Gaussian Mixture Model
Hanqiu Chen1§, Yitu Wang2§, Luis Vitorio Cargnini3, Mohammadreza Soltaniyeh3, Dongyang Li3, Gongjin Sun3, Pradeep Subedi3, Andrew Chang3, Yiran Chen2 and Cong Hao1
1Georgia Institute of Technology, 2Duke University, and 3Samsung Semiconductor, Inc.
§ Equal contribution
Email: hanqiu.chen@gatech.edu
Background
(Hennessy, John L., and David A. Patterson. Computer architecture: a quantitative approach)
Memory wall
Background
(Hennessy, John L., and David A. Patterson. Computer architecture: a quantitative approach)
Memory wall
CXL-enabled memory expansion
Background
(Hennessy, John L., and David A. Patterson. Computer architecture: a quantitative approach)
Memory wall
CXL-enabled memory expansion
DRAM Cache for SSD: Challenges
DRAM data granularity
64 B |
64 B |
64 B |
… |
… |
… |
SSD data granularity
4 KB
64 B |
64 B |
64 B |
… |
… |
… |
Cache pollution & eviction
Granularity mismatch
DRAM Cache for SSD: Challenges
DRAM data granularity
64 B |
64 B |
64 B |
… |
… |
… |
SSD data granularity
4 KB
64 B |
64 B |
64 B |
… |
… |
… |
Cache pollution & eviction
Granularity mismatch
DRAM
FPGA
HW-inefficient cache controller
DRAM Cache for SSD: Challenges
DRAM data granularity
64 B |
64 B |
64 B |
… |
… |
… |
SSD data granularity
4 KB
64 B |
64 B |
64 B |
… |
… |
… |
Cache pollution & eviction
Granularity mismatch
DRAM
FPGA
Large cache miss penalty
HW-inefficient cache controller
DRAM Cache for SSD: Approaches
DRAM
FPGA
DRAM data granularity
64 B |
64 B |
64 B |
… |
… |
… |
SSD data granularity
4 KB
Lightweight HW cache controller
Host CPU
x
Smart caching
If not accessed frequently, do not cache in DRAM but directly to host
DRAM Cache for SSD: Approaches
DRAM
FPGA
Lightweight HW cache controller
Host CPU
x
Smart caching
If not accessed frequently, do not cache in DRAM but directly to host
Algorithm
2D Gaussian Mixture Model (GMM)
2D GMM Motivations: Spatial Patterns
Spatial memory access profiling results
dlrm
parsec
sysbench
Memory access spatial distribution can be fitted with a combination of Gaussian functions
2D GMM Motivations: Temporal Patterns
Temporal memory access profiling results
Uneven access frequency within a specific range of addresses
dlrm
parsec
sysbench
2D GMM: Overview
Spatial
patterns
Temporal
patterns
2D GMM: Overview
Spatial
patterns
Temporal
patterns
2D GMM
2D GMM: Overview
Spatial
patterns
Temporal
patterns
2D GMM
Trained using Expectation-Maximization (EM) algorithm
2D GMM: Overview
Spatial
patterns
Temporal
patterns
2D GMM
Trained using Expectation-Maximization (EM) algorithm
Predict future memory access frequency with:
Trace processing
An example of trace sequence with timestamp annotated
We empirically set len_window = 32,
len_access_shot = 10,000
32
Help capture temporal locality better for long trace
Trace processing
An example of trace sequence with timestamp annotated
We empirically set len_window = 32,
len_access_shot = 10,000
32
An access shot
Help capture temporal locality better for long trace
Trace processing
An example of trace sequence with timestamp annotated
We empirically set len_window = 32,
len_access_shot = 10,000
32
A time window
Help capture temporal locality better for long trace
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
Directly send data back to host from DRAM cache
If cache hit
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Directly send data back to host from DRAM cache
If cache hit
SSD
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Directly send data back to host from DRAM cache
If cache hit
SSD
GMM score indicates access frequency
larger score -> higher frequency
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Score < Threshold
Directly send data back to host from DRAM cache
If cache hit
Directly send data from SSD to host
If cache miss
SSD
❶
❶
GMM score indicates access frequency
larger score -> higher frequency
S < T
Intelligent Caching with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Score < Threshold
Directly send data back to host from DRAM cache
If cache hit
Directly send data from SSD to host
If cache miss
Cache SSD data into DRAM
SSD
❶
❷
❶
❷
GMM score indicates access frequency
larger score -> higher frequency
S < T
Intelligent Eviction with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Score < Threshold
SSD
❶
❷
Block-0
0.63
Block-1
0.73
Block-8
0.61
Set-0
…
Block-0
0.82
Block-1
0.72
Block-8
0.91
Set-N
…
…
GMM score
Data
GMM score is also cached in the DRAM
Eviction when DRAM cache is full
4KB (page size)
Intelligent Eviction with 2D GMM
[page index, time stamp]
Memory request
DRAM cache
Host
Hit
GMM engine
Miss
GMM score
Score < Threshold
SSD
❶
❷
Block-0
0.63
Block-1
0.73
Block-8
0.61
Set-0
…
Block-0
0.82
Block-1
0.72
Block-8
0.91
Set-N
…
…
GMM score
to be evicted
Find the cache block with lowest GMM score to evict
Data
GMM score is also cached in the DRAM
Eviction when DRAM cache is full
Hardware Prototype
ICGMM is prototyped on FPGA, using FPGA DRAM as cache
Opens up a new opportunity of using SmartSSD as a CXL-enabled memory expansion device
Potential application
Hardware Prototype
ICGMM is prototyped on FPGA, using FPGA DRAM as cache
Complex run-time dynamic control
Hardware System Design
An overview of ICGMM design on FPGA (Xilinx Alev0 U50)
ICGMM is prototyped as a dataflow architecture with FIFO interfaces between different modules
Three modules
Hardware System Design
An overview of ICGMM design on FPGA (Xilinx Alev0 U50)
ICGMM is prototyped as a dataflow architecture with FIFO interfaces between different modules
Three modules
Module 1: Cache Policy Engine
Trace FIFO
PA
Time
Rsp FIFO
Ctrl.
Cache policy engine
GMM
PE
Control module
Score
Weight buffer
One-time loading from HBM before kernel starts
Control
Module 1: Cache Policy Engine
Trace FIFO
PA
Time
Rsp FIFO
Ctrl.
Cache policy engine
GMM
PE
Control module
Score
Weight buffer
One-time loading from HBM before kernel starts
Control
Highly parallelized GMM PE
Hardware System Design
An overview of ICGMM design on FPGA (Xilinx Alev0 U50)
ICGMM is prototyped as a dataflow architecture with FIFO interfaces between different modules
Three modules
Module 2: Cache Control Engine
Cache management module
Module 2: Cache Control Engine
Cache management module
SSD access latency emulator
Hardware System Design
An overview of ICGMM design on FPGA (Xilinx Alev0 U50)
ICGMM is prototyped as a dataflow architecture with FIFO interfaces between different modules
Three modules
Module 3: Signal Controller
Controller
Manage control signals on FPGA
Trace FIFO
PA
Time
Rsp FIFO
Ctrl.
Score
HBM bank 1
Trace FIFO
[R/W, PA, Time]
Trace FIFO
R/W
PA
Score FIFO
Score
Rsp FIFO
Hit/miss
To cache control engine
To cache policy engine
Experiment Results: Cache Miss Rate
0.32% ~ 6.14% reduction in cache miss rate
Compared to Least Recently Used (LRU) cache policy, GMM can achieve
The policy we choose is marked in shadow
The cache miss rate comparison
Setting: cach size = 64MB, block size = 4KB, associativity = 8. We use 256 Gaussian functions.
Experiment Results: SSD access latency
Average SSD access latency
Compared to Least Recently Used (LRU) cache policy, GMM can achieve
16.23% ~ 39.14% reduction in SSD access latency
Setting: read latency = 75𝜇𝑠 and write latency = 900𝜇𝑠
Experiment Results: Hardware Performance
Resource utilization and latency comparison between a lightweight LSTM and GMM for cache policy engine
Compared to LSTM cache controller, GMM has following benefits:
More than 10,000x latency reduction with only 2% BRAM utilization
Completely hidden GMM overhead with dataflow streaming
Experiment Results: Hardware Performance
Resource utilization and latency comparison between a lightweight LSTM and GMM for cache policy engine
Compared to LSTM cache controller, GMM has following benefits:
More than 10,000x latency reduction with only 2% BRAM utilization
Completely hidden GMM overhead with dataflow streaming
The lightweight LSTM has low cache hit rate (<50%)
Summary & Thanks