university of maryland automatically adapting sampling rates to minimize overhead geoff stoker
TRANSCRIPT
![Page 1: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/1.jpg)
University of Maryland
Automatically Adapting Sampling Rates to Minimize Overhead
Geoff Stoker
![Page 2: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/2.jpg)
University of Maryland 2
Sample of Sampling Practices
200 samples/sec [T09]
20,000 samples/sec [A05]
2.5% of all memory operations [O05]
15 sec periods of detailed CPU analysis; 10 sec periods for memory [R08]
1,000,000 consecutive memory accesses – then skip 9,000,000 [W08]
![Page 3: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/3.jpg)
University of Maryland
Intuition
3
Performance(time)
actual program performance
PerturbationError
MeasurementError
Best PossibleMeasurement
# of samples
![Page 4: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/4.jpg)
University of Maryland 4
Mathematical Model
How much run time is attributable to foo() ?
T(n) = measured time when taking n samples
p = proportion of given function o = overhead cost per sample Ta = running time of entire program z = confidence level z value
n
ppzpTnponT a
)1()(
![Page 5: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/5.jpg)
University of Maryland
Mathematical Model
5
n
ppzpTnponT a
)1()(
32
)1()(
n
ppzTponT a
3
2
2
)1(
po
ppzTn a
![Page 6: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/6.jpg)
University of Maryland 6
Example
Ta = may not know it, so best guess z = 1.96 for 95% CL p = probably don’t know it, so
use .15– Why? 0<=p<=1; p(1-p) ranges .00 - .25;
when p=.15, p(1-p) is .1275, a middle value o = 250 µseconds (empirical tool
use)
3
2
2
)1(
po
ppzTn a
![Page 7: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/7.jpg)
University of Maryland 7
Example Continued
Time in seconds, # of samples to best measurement is:– Ta = 300, n = 19,863
– Ta = 600, n = 31,531
– Ta = 900, n = 41,317
Observation: sampling rate decreases non-linearly as time increases– Ta = 300, sample rate = 66/s
– Ta = 600, sample rate = 53/s
– Ta = 900, sample rate = 46/s
![Page 8: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/8.jpg)
University of Maryland
Sample Size vs Accuracy
8
One order of magnitude accuracy change
Two orders of magnitude sample size change
![Page 9: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/9.jpg)
University of Maryland 9
Adapting Sampling Rates
Prior to a performance analysis run– Calculate “best” sampling rate per parameters of run
• Confidence level• Confidence interval• Estimated execution time• Sampling overhead
During a performance analysis run– Adjust the sampling rate based on intermediate
analysis• Function taking largest proportion of execution
time• Total observed execution time
![Page 10: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/10.jpg)
University of Maryland
Example Simulation Result
10
Best PossibleMeasurement
Measured value for
target function(time)
# of samples
![Page 11: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/11.jpg)
University of Maryland 11
Future Work/Conclusion
Finish tool construction
Generate results – Validate simulation results on test programs– Test technique with real programs
Explore dynamic overhead calculation
Questions?
![Page 12: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/12.jpg)
University of Maryland
BACK-UP SLIDES
12
![Page 13: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/13.jpg)
University of Maryland 13
Jain vs Lilja
Sample size for determining proportions
– J: r is CI for p/100
– L: r is CI for ci/p
J, The Art of Computer Systems Performance Analysis, 1991, pg 217. L, Measuring Computer Performance, 2000, pg 55.
2
2 )1(
r
ppzn
22 )1(
pr
ppzn
![Page 14: University of Maryland Automatically Adapting Sampling Rates to Minimize Overhead Geoff Stoker](https://reader037.vdocuments.mx/reader037/viewer/2022110401/56649e025503460f94aeda51/html5/thumbnails/14.jpg)
University of Maryland
Intuition Refined
14
Best PossibleMeasurement