1 of 91

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

2 of 91

Executive Summary (I)

2

  • Long memory access latency significantly limits performance of modern high-performance processors

  • Prefetching and off-chip prediction (OCP) are two orthogonal techniques proposed to hide long memory access latency

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

  • Autonomously coordinates off-chip prediction with multiple prefetchers
  • Provides consistent performance benefits, regardless of workloads and system configurations

3 of 91

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

  • Models the coordination between prefetchers and off-chip predictor (OCP) as a reinforcement learning (RL) problem
  • Observes multiple system-level features over an epoch of program execution
  • Takes a coordination action (i.e., enabling the prefetcher and/or OCP, and adjusting prefetcher aggressiveness)
  • Receives a numerical reward to autonomously and continuously learn 

Our Proposal

Evaluation

  • Evaluated with 100 workloads, 6 prefetchers, 3 OCPs, 4 cache designs, and a wide range of main memory bandwidth configurations

  • Consistently outperforms both heuristic- and learning-based policies in every prefetcher/OCP/bandwidth configurations on average by 3.6% - 10.3%

4 of 91

Outline

4

Background

Motivation

Athena

Evaluation

Conclusion

5 of 91

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

6 of 91

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?

7 of 91

Outline

7

Background

Athena

Evaluation

Conclusion

Motivation

8 of 91

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

9 of 91

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

10 of 91

Ob. 2: Naively Combining OCP with Prefetching Fails to Realize their Full Performance Potential

10

14.1%

6.5%

StaticBest <POPET, Pythia>

11 of 91

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

12 of 91

Ob. 3: Existing Coordination Policies Fall Short

12

TLP [Jamet+, HPCA’24] is the only technique proposed

to combine OCP with a prefetcher

13 of 91

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

14 of 91

Ob. 3: Existing Coordination Policies Fall Short

14

9.2%

3.4%

5.9%

15 of 91

Ob. 3: Existing Coordination Policies Fall Short

15

9.2%

3.4%

5.9%

Existing coordination policies

leave a large performance potential behind

16 of 91

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

17 of 91

Our Proposal

17

Formulates the coordination between prefetchers and OCP

as a reinforcement learning problem

18 of 91

Outline

18

Background

Motivation

Evaluation

Conclusion

Athena

19 of 91

Basics of Reinforcement Learning (RL)

  • An algorithmic approach to learn to take an action in a given state to maximize a numerical reward

  • Agent stores Q-values for every state-action pair
    • Expected reward for taking an action in a state
  • Given a state, the agent selects the action that provides the highest Q-value

19

Environment

Action (at)

Reward (Rt+1)

Agent

State (st)

20 of 91

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)

21 of 91

What is State?

21

  • Vector of system-level features
  • State := [Feature 1, Feature 2, …]

  • Captures runtime behavior of the memory subsystem

Perform offline feature selection to determine the final subset

of features that Athena uses to construct the state vector

  • Prefetcher accuracy
  • OCP accuracy
  • Bandwidth usage
  • Cache pollution
  • Prefetch bandwidth
  • OCP bandwidth
  • Demand bandwidth

Example Features

Automated Design-Space Exploration

22 of 91

What is Action?

  • Prefetcher /

  • OCP /

  • Adjust the aggressiveness of prefetcher

22

23 of 91

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

24 of 91

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

25 of 91

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

26 of 91

What is Reward?

  • Defines the objective of Athena

  • Intuitive reward: instructions committed per cycle (IPC) 

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

27 of 91

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

  • Load instructions
  • Mispredicted branches

28 of 91

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

  • Load instructions
  • Mispredicted branches

Potentially broadly applicable to many other

microarchitectural decision-making processes 

29 of 91

Final Configuration of Athena

29

Four features

  • Prefetcher accuracy
  • OCP accuracy
  • Bandwidth usage
  • Prefetcher-induced cache pollution

Coarse-grained action

  • Enable prefetcher
  • Enable OCP
  • Enable both
  • Enable none

Fine-grained action

  • Q-value driven prefetcher aggressiveness control

Correlated reward

  • Cycles
  • LLC misses
  • LLC miss latency

Uncorrelated reward

  • Load instructions
  • Mispredicted branches

State

Action

Reward

30 of 91

More in the Paper

  • Detailed design of Athena
    • Architecture to store and retrieve Q-values

  • Automated design space exploration
    • Feature selection
    • Reward tuning
    • Hyperparameter tuning

  • Mechanism to measure system state
    • Prefetcher accuracy
    • OCP accuracy
    • Cache pollution
    • Main memory bandwidth usage

  • Storage and latency overhead analysis

30

31 of 91

More in the Paper

31

32 of 91

Outline

32

Background

Motivation

Athena

Conclusion

Evaluation

33 of 91

ChampSim Trace-Driven Simulation Methodology

33

  • IPCP [Pakalapati+, ISCA’20]
  • Berti [Navarro-Torres+, MICRO’22]
  • Pythia [Bera+, MICRO’21]
  • SPP+ PPF [Bhatia+, ISCA’20]
  • SMS [Somogyi+, ISCA’06]
  • MLOP [Shakerinava+, DPC3’19]

Prefetchers

  • 100 single-core workloads
  • 180 four-core and eight-core workload mixes

Workloads

  • Hermes [Bera+, MICRO’22]
  • HMP [Yoaz+, ISCA’99]
  • TTP [Jalili+, HPCA’22]

Off-Chip Predictors

  • # cores: 1- 8 cores
  • Main memory bandwidth: �1.6 GB/s – 12.8 GB/s
  • 4 cache designs with various prefetchers at different cache levels

System Configurations

  • HPAC [Ebrahimi+, MICRO’09]
  • MAB [Yoaz+, ISCA’99]
  • TLP [Jamet+, HPCA’24]

Coordination Policies

34 of 91

Trace-Driven Simulation Methodology

34

  • IPCP [Pakalapati+, ISCA’20]
  • Berti [Navarro-Torres+, MICRO’22]
  • Pythia [Bera+, MICRO’21]
  • SPP+ PPF [Bhatia+, ISCA’20]
  • SMS [Somogyi+, ISCA’06]
  • MLOP [Shakerinava+, DPC3’19]

Prefetchers

  • 100 single-core workloads
  • 180 four-core and eight-core workload mixes

Workloads

  • Hermes [Bera+, MICRO’22]
  • HMP [Yoaz+, ISCA’99]
  • TTP [Jalili+, HPCA’22]

Off-chip Predictors

  • # cores: 1- 8 cores
  • Main memory bandwidth: �1.6 GB/s – 12.8 GB/s
  • 4 cache designs with various prefetchers at different cache levels

System Configurations

  • HPAC [Ebrahimi+, MICRO’09]
  • MAB [Yoaz+, ISCA’99]
  • TLP [Jamet+, HPCA’24]

Coordination Policies

Open-sourced and artifact-evaluated

with all three badges

35 of 91

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

36 of 91

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

37 of 91

Speedup in Cache Design 1

37

4.8%

7.5%

1.5%

6.2%

5.0%

38 of 91

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

39 of 91

Speedup in Cache Design 1

39

40 of 91

Speedup in Cache Design 1

40

Athena provides similar performance gains

as the StaticBest combination

41 of 91

Performance Sensitivity to Varying Prefetchers

41

5.0%

5.4%

3.6%

5.0%

42 of 91

Performance Sensitivity to Varying OCPs

42

5.0%

4.7%

8.2%

43 of 91

Performance Sensitivity to Varying OCPs

43

5.0%

4.7%

8.2%

Athena provides consistent performance benefits

across diverse prefetcher and OCP types

44 of 91

More Evaluations in the Paper

  • Performance improvement in three other cache designs

  • Performance sensitivity study across diverse system configurations
    • Varying L1D prefetcher
    • Varying OCP request issue latency
    • Varying main memory bandwidth
  • Understanding Athena using a case study

  • Employing Athena for prefetcher-only management

  • Additional results in the extended version on arXiv:
    • Effect of Athena on main memory request
    • Effect of Athena on LLC load miss latency
    • Performance improvement of Athena on 359 additional unseen traces

44

45 of 91

More Evaluations in the Paper

45

46 of 91

Athena is Open Sourced

46

  • SPEC CPU 2006 & 2017
  • PARSEC 2.1
  • Ligra graph processing workloads
  • Real-world INT, FP

100 Workloads

  • IPCP [Pakalapati+, ISCA’20]
  • Berti [Navarro-Torres+, MICRO’22]
  • Pythia [Bera+, MICRO’21]
  • SPP+PPF [Kim+, MICRO’16]
  • SMS [Somogyi+, ISCA’06]
  • MLOP [Shakerinava+, DPC3’19]

Six Prefetchers

  • POPET [Bera+, MICRO’22]
  • HMP [Yoaz+, ISCA’99]
  • TTP [Jalili+, HPCA’22; Bera+, MICRO’22]

Three OCPs

  • TLP [Jamet+, HPCA’24]
  • HPAC [Ebrahimi+, MICRO’09]
  • MAB [Gerogiannis+, MICRO’23]
  • Athena (Our Proposal)

Four Policies

47 of 91

Outline

47

Conclusion

Background

Motivation

Athena

Evaluation

48 of 91

48

Evaluation

  • Evaluated with 100 workloads, 6 prefetchers, 3 OCPs, 4 cache designs, and a wide range of main memory bandwidth configurations

  • Consistently outperforms both best-prior heuristic- and learning-based policies in every prefetcher/OCP/bandwidth configuration

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

49 of 91

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

50 of 91

BACKUP

50

51 of 91

Index

  • Motivational data

  • Methodology

51

52 of 91

POPET vs. Pythia Performance Line Graph

52

Accuracy

Performance

Pythia

28.7%

-10.5%

POPET

84.1%

+10.3%

53 of 91

Athena Performance Headroom

53

54 of 91

Off-Chip Prefetch Fills are not Always Inaccurate

54

55 of 91

Prior Works Leave Performance Potential Behind

55

56 of 91

Candidate Features Considered

56

57 of 91

Q-Value-Driven �Prefetcher Aggressiveness Control

57

58 of 91

Reward Framework

58

59 of 91

Q-Value Retrieval from QVStore

59

60 of 91

Final Configuration of Athena

60

61 of 91

Storage Overhead of Athena

61

62 of 91

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

<<

63 of 91

Evaluated System Parameters

63

64 of 91

Evaluated Workloads

64

65 of 91

Evaluated Cache Designs

65

66 of 91

Storage Overhead Comparison

66

67 of 91

Speedup in CD1

67

68 of 91

CD1 Speedup – Deepdive

68

69 of 91

CD1 Speedup – Compared to StaticBest

69

70 of 91

CD1 – Impact on Main Memory Requests

70

71 of 91

CD1 – Impact on LLC Load Miss Latency

71

72 of 91

CD1 – Sensitivity to L2C Prefetcher Type

72

73 of 91

CD1 – Sensitivity to OCP Type

73

74 of 91

CD1 – Sensitivity to OCP Request Issue Latency

74

75 of 91

CD1 – Sensitivity to Warmup Length

75

76 of 91

Speedup in CD2

76

77 of 91

Speedup in CD3

77

78 of 91

Speedup in CD4

78

79 of 91

CD4 – Sensitivity to L1D Prefetcher Type

79

80 of 91

CD4 – Sensitivity to Main Memory Bandwidth

80

81 of 91

Four-Core Evaluation Results

81

82 of 91

Eight-Core Evaluation Results

82

83 of 91

Understanding Athena using a Case Study

83

84 of 91

Athena Ablation Study

84

85 of 91

Athena for Prefetcher-Only Management

85

86 of 91

Athena on Unseen Workloads

86

Across 359 Google datacenter workload traces

released in DPC4

87 of 91

Old Slides

87

88 of 91

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

89 of 91

Athena: Detailed Design

89

Q-Value�Table

Q-Value�Table

QVStore

+

State

Action

90 of 91

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

91 of 91

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

.�.�.

.�.�.