





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Reza Azimi, Michael Stumm, Reza Azimi, Michael Stumm,
and Robert W. Wisniewski and Robert W. Wisniewski
International Conference on Supercomputing (2005) International Conference on Supercomputing (2005)
Presented by Fabrice Baijot Presented by Fabrice Baijot
► ►
► ►
► ►
► ►
► ►
► ►
► ►
Limited number of Limited number of
HPCs HPCs
in PMUs in PMUs
► ►
Limited number of events Limited number of events
Only specific subsets of events can be counted Only specific subsets of events can be counted
together together
► ►
Doing multiple runs of same application with Doing multiple runs of same application with different event subsets not viable (why?) different event subsets not viable (why?)
Getting useful metrics requires: Getting useful metrics requires:
► ►
Detailed knowledge of micro Detailed knowledge of micro
architecture architecture
► ►
Combining sets of events for complete picture Combining sets of events for complete picture
PMU programming is only possible in kernel PMU programming is only possible in kernel
mode mode
► ►
Implementing it as a user process incurs too much Implementing it as a user process incurs too much overhead (why?) overhead (why?)
► ►
Library provides interface to users Library provides interface to users
► ►
Programming interface programs PMUs and configures Programming interface programs PMUs and configures
sampling engine sampling engine
► ►
Sampling engine implements HPC multiplexing and SSB Sampling engine implements HPC multiplexing and SSB
model model
► ►
HPC values can be read directly or logged in per HPC values can be read directly or logged in per
process process
PMU log PMU log
(Section 2, p.2)
► ►
Default sampling frequency is 200,000 cycles Default sampling frequency is 200,000 cycles
► ►
Sampling engine maintains HPC contexts and Sampling engine maintains HPC contexts and
switches them when OS switches processes switches them when OS switches processes
► ►
Three modes of operation: Three modes of operation:
Kernel only Kernel only
User only User only
Full system Full system
► ►
Address space indicates context Address space indicates context
Threads sharing address space are not distinguished Threads sharing address space are not distinguished
► ►
Stall Stall
► ►
miss event
miss event
► ►
(Section 4, p.6)
► ►
Where Where
i i
is the number of stalls caused by is the number of stalls caused by
miss event miss event
C C
is an estimate of the CPI when idealizing is an estimate of the CPI when idealizing
miss events miss events
Real Real
is elapsed cycles / instructions retired is elapsed cycles / instructions retired
► ►
CPI CPI
C C
(section 4, p.5)
► ►
Micro Micro
architecture details difficult to understand architecture details difficult to understand
Sometimes requires access to proprietary Sometimes requires access to proprietary
information information
Consequently, a large set of micro Consequently, a large set of micro
benchmarks benchmarks
were created to monitor specific events in were created to monitor specific events in
isolation isolation
Results gave authors ‘confidence’ that system Results gave authors ‘confidence’ that system
“correctly captures most of the hardware “correctly captures most of the hardware
events” examined events” examined
► ►
Goal is to compare probability of event Goal is to compare probability of event
occurring in interval occurring in interval
i i
to probability of event to probability of event
occurring in a subinterval of occurring in a subinterval of
ii
(why?) (why?)
Using Using
Kullback Kullback
Leibler Leibler
distance (integral of log distance (integral of log
likelihood) where < 0.2 is deemed acceptable likelihood) where < 0.2 is deemed acceptable
In other words, the distance between the In other words, the distance between the
averages of the sampling distributions should averages of the sampling distributions should
not exceed 15% not exceed 15%
► ►
Left: avg instr retired/cycle Left: avg instr retired/cycle
Right: avg L1 DCache misses/cycle Right: avg L1 DCache misses/cycle
(Section 6, p.7)
► ►
Examining events with high KL Examining events with high KL
distance values: distance values:
Left: effect of sampling granularity Left: effect of sampling granularity
Right: effect of sampling ratio (granularity fixed @ Right: effect of sampling ratio (granularity fixed @
500,000 cycles) 500,000 cycles)
(Section 6, p.8)
Conclusions: for infrequent HW events, higher Conclusions: for infrequent HW events, higher
granularity is better, fixed ratio is granularity is better, fixed ratio is
acceptable acceptable
► ►
Can focus on minimizing DCache misses Can focus on minimizing DCache misses
Results show that standard optimizations should Results show that standard optimizations should
also try to reduce data cache misses also try to reduce data cache misses
Online availability of SSB information allows Online availability of SSB information allows
runtime optimizer to monitor an application and runtime optimizer to monitor an application and
apply optimizations in a feedback loop apply optimizations in a feedback loop
► ►
Increases linearly with sampling frequency Increases linearly with sampling frequency
2% overhead at 20,000 samples per second is 2% overhead at 20,000 samples per second is
suitable for runtime optimizations suitable for runtime optimizations
(Section 6, p.8)