�Synergizing Data Prefetching and Off-Chip Prediction �via Online Reinforcement Learning
Rahul Bera, Zhenrong Lang
Caroline Hengartner, Konstantinos Kanellopoulos, Rakesh Kumar,
Mohammad Sadrosadati, Onur Mutlu
Executive Summary (I)
2
Background
Key Insights
Existing coordination policies leave a large performance potential behind
Naively combining OCP with prefetching often fails to realize their full
performance potential
OCP and prefetching provide complementary performance benefits
Goal
Executive Summary (II)
3
Contributions
Works as a prefetcher-OCP coordinator and a prefetcher throttler, at the same time, without any additional hardware
Introduces a composite reward framework that isolates the true impact of Athena’s own action from inherent variations in workload behavior
Athena
Our Proposal
Evaluation
Outline
4
Background
Motivation
Athena
Evaluation
Conclusion
Key Problem and Its Potential Solutions
5
Long memory access latency
remains a key performance bottleneck in modern processors
Key latency hiding techniques:
1
Data prefetching
2
Off-chip prediction
Data Prefetching and Off-Chip Prediction
6
Predicts address of future memory requests�
Hides the memory
access latency�
Bandwidth overhead
and cache pollution
Predicts whether a given memory request would go off-chip
Often more accurate
predictions�
Lower timeliness than a
prefetcher
Data prefetcher
Off-chip predictor
How do they behave together?
Outline
7
Background
Athena
Evaluation
Conclusion
Motivation
Ob. 1: Data Prefetching and Off-Chip Prediction Provide Complementary Performance Benefits
8
In bandwidth-constrained processor with 3.2 GB/s of main memory bandwidth
(OCP)
(Prefetcher)
Prefetcher-friendly
Prefetcher-adverse
Ob. 1: Data Prefetching and Off-Chip Prediction Provide Complementary Performance Benefits
9
In bandwidth-constrained processor with 3.2 GB/s of main memory bandwidth
(OCP)
(Prefetcher)
Prefetcher-friendly
Prefetcher-adverse
Data prefetching and off-chip prediction provide complementary performance benefits
Ob. 2: Naively Combining OCP with Prefetching Fails to Realize their Full Performance Potential
10
14.1%
6.5%
StaticBest <POPET, Pythia>
Ob. 2: Naively Combining OCP with Prefetching Fails to Realize their Full Performance Potential
11
14.1%
6.5%
StaticBest <POPET, Pythia>
Naively combining OCP with prefetching often
fails to realize their full performance potential
Ob. 3: Existing Coordination Policies Fall Short
12
TLP [Jamet+, HPCA’24] is the only technique proposed
to combine OCP with a prefetcher
Ob. 3: Existing Coordination Policies Fall Short
13
TLP [Jamet+, HPCA’24] is the only technique proposed
to combine OCP with a prefetcher
Can coordinate OCP with prefetcher employed only at the L1 data cache
Ob. 3: Existing Coordination Policies Fall Short
14
9.2%
3.4%
5.9%
Ob. 3: Existing Coordination Policies Fall Short
15
9.2%
3.4%
5.9%
Existing coordination policies
leave a large performance potential behind
Our Goal
16
Design a holistic framework that
Autonomously synergizes OCP with
multiple prefetchers throughout the cache hierarchy
To deliver consistent performance benefits,
regardless of workloads and system configuration
Our Proposal
17
Formulates the coordination between prefetchers and OCP
as a reinforcement learning problem
Outline
18
Background
Motivation
Evaluation
Conclusion
Athena
Basics of Reinforcement Learning (RL)
19
Environment
Action (at)
Reward (Rt+1)
Agent
State (st)
Formulating Coordination as RL
20
Environment
Action (at)
Reward (Rt+1)
Agent
State (st)
Processor & Memory Subsystem
Action�1) enable/disable prefetcher and OCP
2) set prefetcher aggressiveness
Reward
Athena
State
(e.g., bandwidth usage, prefetcher/OCP accuracy)
What is State?
21
Perform offline feature selection to determine the final subset
of features that Athena uses to construct the state vector
Example Features
Automated Design-Space Exploration
What is Action?
22
What is Action?
23
>> avg( , , )
OCP Only
Prefetcher Only
Neither Enabled
Both Enabled
2
28
4
9
The magnitude of the selected action’s Q-value implicitly encodes Athena’s confidence in taking that action
State vector
Q-Value-Driven Prefetcher Aggressiveness Control
24
Key Idea: Use the Q-value difference to control prefetcher aggressiveness
Low ∆Q
🡪 Low aggressiveness
High ∆Q 🡪 High aggressiveness
Calculate Q-value difference
∆Q ← Q(a*) − avg (Q(remaining actions))
Drive prefetcher aggressiveness using ∆Q
Q-Value-Driven Prefetcher Aggressiveness Control
25
Key Idea: Use the Q-value difference to control prefetcher aggressiveness
Low ∆Q
🡪 Low aggressiveness
High ∆Q 🡪 High aggressiveness
Calculate Q-value difference
∆Q ← Q(a*) − avg (remaining actions)
Drive prefetcher aggressiveness using ∆Q
Athena works as a prefetcher-OCP coordinator and a prefetcher throttler, at the same time, using the same hardware
What is Reward?
26
Using IPC as the sole reward can be unreliable and may mislead the learned policy
Change in IPC
Coordination actions taken by Athena
Inherent variation in workload behavior
Athena's Composite Reward Framework
27
Allows Athena to autonomously learn a coordination policy
by isolating the true impact of its actions
from inherent variations in workload behavior
Athena’s overall reward
Correlated reward
Reflects the effect of
Athena’s action
- Cycles
- LLC misses
- LLC miss latency
Uncorrelated reward
Reflects inherent
workload variation
Athena's Composite Reward Framework
28
Allows Athena to autonomously learn a coordination policy
by isolating the true impact of its actions
from inherent variations in workload behavior
Athena’s overall reward
Correlated reward
Reflects the effect of
Athena’s action
- Cycles
- LLC misses
- LLC miss latency
Uncorrelated reward
Reflects inherent
workload variation
Potentially broadly applicable to many other
microarchitectural decision-making processes
Final Configuration of Athena
29
Four features
Coarse-grained action
Fine-grained action
Correlated reward
Uncorrelated reward
State
Action
Reward
More in the Paper
30
More in the Paper
31
Outline
32
Background
Motivation
Athena
Conclusion
Evaluation
ChampSim Trace-Driven Simulation Methodology
33
Prefetchers
Workloads
Off-Chip Predictors
System Configurations
Coordination Policies
Trace-Driven Simulation Methodology
34
Prefetchers
Workloads
Off-chip Predictors
System Configurations
Coordination Policies
Open-sourced and artifact-evaluated
with all three badges
Evaluated Cache Designs
35
Cache Design 1
Cache Design 2
Cache Design 3
Cache Design 4
PF
OCP
OCP
OCP
OCP
PF
PF1
PF2
PF1
PF2
Evaluated Cache Designs
36
Cache Design 1
Cache Design 2
Cache Design 3
Cache Design 4
PF
OCP
OCP
OCP
OCP
PF
PF1
PF2
PF1
PF2
Speedup in Cache Design 1
37
4.8%
7.5%
1.5%
6.2%
5.0%
Speedup in Cache Design 1
38
4.8%
7.5%
1.5%
6.2%
5.0%
Athena consistently outperforms prior prefetcher control policies
in all workload categories
Athena outperforms the best-prior coordination policy MAB
by 5% on average
Speedup in Cache Design 1
39
Speedup in Cache Design 1
40
Athena provides similar performance gains
as the StaticBest combination
Performance Sensitivity to Varying Prefetchers
41
5.0%
5.4%
3.6%
5.0%
Performance Sensitivity to Varying OCPs
42
5.0%
4.7%
8.2%
Performance Sensitivity to Varying OCPs
43
5.0%
4.7%
8.2%
Athena provides consistent performance benefits
across diverse prefetcher and OCP types
More Evaluations in the Paper
44
More Evaluations in the Paper
45
Athena is Open Sourced
46
100 Workloads
Six Prefetchers
Three OCPs
Four Policies
Outline
47
Conclusion
Background
Motivation
Athena
Evaluation
48
Evaluation
The first reinforcement learning-based mechanism to coordinate
off-chip predictor and multiple prefetchers
Contributions
Works as a prefetcher-OCP coordinator and a prefetcher throttler, at the same time, without any additional hardware
Introduces a composite reward framework that isolates the true impact of Athena’s own action from inherent variations in workload behavior
�Synergizing Data Prefetching and Off-Chip Prediction �via Online Reinforcement Learning
Rahul Bera, Zhenrong Lang, Caroline Hengartner, Konstantinos Kanellopoulos,
Rakesh Kumar, Mohammad Sadrosadati, Onur Mutlu
BACKUP
50
Index
51
POPET vs. Pythia Performance Line Graph
52
| Accuracy | Performance |
Pythia | 28.7% | -10.5% |
POPET | 84.1% | +10.3% |
Athena Performance Headroom
53
Off-Chip Prefetch Fills are not Always Inaccurate
54
Prior Works Leave Performance Potential Behind
55
Candidate Features Considered
56
Q-Value-Driven �Prefetcher Aggressiveness Control
57
Reward Framework
58
Q-Value Retrieval from QVStore
59
Final Configuration of Athena
60
Storage Overhead of Athena
61
Why is Athena’s Latency Overhead Minimal?
62
Epochk
Epochk+1
Epochk+2
Epochk+3
2000 instructions
Latency of
Q-Value updates
Latency to
execute an epoch
<<
Evaluated System Parameters
63
Evaluated Workloads
64
Evaluated Cache Designs
65
Storage Overhead Comparison
66
Speedup in CD1
67
CD1 Speedup – Deepdive
68
CD1 Speedup – Compared to StaticBest
69
CD1 – Impact on Main Memory Requests
70
CD1 – Impact on LLC Load Miss Latency
71
CD1 – Sensitivity to L2C Prefetcher Type
72
CD1 – Sensitivity to OCP Type
73
CD1 – Sensitivity to OCP Request Issue Latency
74
CD1 – Sensitivity to Warmup Length
75
Speedup in CD2
76
Speedup in CD3
77
Speedup in CD4
78
CD4 – Sensitivity to L1D Prefetcher Type
79
CD4 – Sensitivity to Main Memory Bandwidth
80
Four-Core Evaluation Results
81
Eight-Core Evaluation Results
82
Understanding Athena using a Case Study
83
Athena Ablation Study
84
Athena for Prefetcher-Only Management
85
Athena on Unseen Workloads
86
Across 359 Google datacenter workload traces
released in DPC4
Old Slides
87
Automated Design Space Exploration
88
4 Final Features
Feature N
Feature 1
Feature 2
Prefetcher accuracy, OCP accuracy, bandwidth usage, and prefetch-induced cache pollution
Athena: Detailed Design
89
Q-Value�Table
Q-Value�Table
QVStore
+
State
Action
Athena: Detailed Design
90
Q-Value�Table
Q-Value�Table
QVStore
+
State
Action
Athena adopts a lightweight and hardware-friendly
tabular organization for storing Q-values, tailored for
low-latency access and online updates
Putting it all Together
91
Feature1
Feature2
FeatureF
State vector
.�.�.
concatenate
(32-bit)
𝚺
Q(s, a)
sum partial�Q-values
argmax
a*
q1(s, a)
q2(s, a)
qk(s, a)
Plane1��
Plane2��
Planek��
#
hash1
index
#
hash2
index
#
hashk
index
.�.�.
.�.�.