Locality Phase Prediction Xipeng Shen Yutao Zhong Chen
- Slides: 40
Locality Phase Prediction Xipeng Shen, Yutao Zhong, Chen Ding Computer Science Department, University of Rochester Class Discussion prepared by Bumyong Choi University of California San Diego
Memory Adaptation n Programs exhibit dynamic locality n Several studies have been done, but require manual analysis to find program phases n Locality-based phase prediction can solve the problem University of California San Diego
Previous Analysis n Interval Based n Unclear what the best interval length is n Code-based n The program structure may not reveal its locality pattern n In-lined function, intertwined functions calls University of California San Diego
The new technique n Locality analysis n No fixed-size windows n Phase marking n All instructions in the program binary University of California San Diego
Locality Phase n A period of a program execution that has stable or slow changing data locality. n We are interested in phases that are repeatedly executed with similar locality for optimization purpose. n Phase Prediction: knowing a phase and its locality whenever the execution enters the phase. University of California San Diego
Examples of Recurring Locality Phases n The aging of airplane model n Structural/mechanical/molecular n Other scientific and commercial simulations n GREAT DEMAND FOR COMPUTING RESOURCES!! n Exhibit dynamic but stable phases n Good candidates for adaptation, if we can predict locality phases University of California San Diego
Program Phase Source: Phase Tracking and Prediction (Sherwood et al) University of California San Diego
Downside University of California San Diego
Motivation for the use of locality analysis n Recent studies found that reuse-distance histograms change in predictable patterns in many programs n Reuse distance reveals patterns in program locality University of California San Diego
Reuse Distance n The number of distinctive data elements accessed between two consecutive uses of the same element University of California San Diego
Reuse Distance Example abcaacb rd=2 University of California San Diego
Reuse Distance Example abcaacb rd=0 University of California San Diego
Reuse Distance Example abcaacb rd=1 University of California San Diego
Reuse Distance Example abcaacb rd=2 University of California San Diego
Reuse Distance Example abcaacb rd=0 University of California San Diego
The reuse-distance trace of Tomcatv University of California San Diego
What the example confirms. . n Major shifts in program locality are marked by radical changes n Locality phases have different length n The size changes greatly with program inputs n A phase is a unit of repeating behavior rather than a unit of uniform behavior University of California San Diego
New Locality Prediction Method 1. Analyzes the data locality in profiling runs 1. Variable-distance sampling 2. Wavelet filtering 3. Optimal Phase Partitioning 2. Analyzes the instruction trace and identifies the phase boundaries in the code 3. Uses grammar compression to identify phase hierarchies and then inserts program markers through binary rewriting. University of California San Diego
Off-line Analysis Variable-distance sampling Optimal Phase Partitioning Filtering(Wavelet) University of California San Diego
Variable-distance sampling 1. A small number of representative data 2. Only long-distance reuses 3. Uses dynamic feedback to find suitable thresholds University of California San Diego
Wavelet Filtering n Used as a filter to expose abrupt changes in the reuse pattern – removes temporal redundancy n Common Technique in signal an image processing n Shows the change of frequency over time. Further Reading on Wavelet: I. Daubechies. Ten Lectures on Wavelets. Capital City Press, Montpelier, Vermont, 1992 University of California San Diego
Wavelet Filtering n. The wavelet filtering removes reuses of the same data within a phase University of California San Diego
Optimal Phase Partitioning n Removes the spatial redundancy. n Conditions for a good phase partition n A phase should include accesses to as many data samples as possible. n A phase should not include multiple accesses of the same data sample. University of California San Diego
Optimal Phase Partitioning n Filtered trace -> a directed acyclic graph n Each edge has a weight . . n More details : in the paper. University of California San Diego
New Prediction Method 1. Analyzes the data locality in profiling runs 1. Variable-distance sampling 2. Wavelet filtering 3. Optimal Phase Partitioning 2. Analyzes the instruction trace and identifies the phase boundaries in the code 3. Uses grammar compression to identify phase hierarchies and then inserts program markers through binary rewriting. University of California San Diego
Phase Marker Selection n This step finds the basic blocks in the code that uniquely mark detected phases. n Examines all instruction blocks n Possible that the high level program structure may be lost due to compiler optimizations University of California San Diego
Phase Marker Selection n Phase detection finds the number of phases but cannot locate the precise time of phase transitions. Hundreds of memory access vs a few memory references in basic block n What about gradual transition? n University of California San Diego
Phase Marker Selection n Solution? n Using the frequency of the phases instead of the time of their transition n Marker Block: a basic block that is always executed at the beginning of phase based on the frequency found n If blank region (removed blocks) is larger than threshold, it is considered as a phase execution. University of California San Diego
New Prediction Method 1. Analyzes the data locality in profiling runs 1. Variable-distance sampling 2. Wavelet filtering 3. Optimal Phase Partitioning 2. Analyzes the instruction trace and identifies the phase boundaries in the code 3. Uses grammar compression to identify phase hierarchies and then inserts program markers through binary rewriting. University of California San Diego
Hierarchical Construction n SEQUITUR n Compresses a string of symbols into a Context Free Grammar n By constructing the phase hierarchy, we find phases of the largest granularity. University of California San Diego
Phase Marker Insertion n ATOM- binary rewriting tool n The basic phases (the leaves of the phase hierarchy) have unique markers in the program, so their prediction is trivial. n Based on the phase hierarchy, we make prediction. n Finite automaton to recognize the current phase in the phase hierarchy. University of California San Diego
Evaluation 1. Measure the granularity and accuracy of phase prediction 2. Cache resizing 3. Memory remapping 4. Test the result against manual phase marking University of California San Diego
Phase Prediction University of California San Diego
Phase Prediction University of California San Diego
Adaptive Cache-resizing University of California San Diego
Memory-remapping n Assume: the support of Impluse controller n Key requirement: identify when remapping is profitable University of California San Diego
Manual vs Phase University of California San Diego
Conclusions n General method for predicting hierarchical memory phases in programs with inputdependent but consistent phase-behavior n Predicts the length and locality with near perfect accuracy n It reduces cache size by 40% without increasing the number of cache misses n It improves program performance by 35% when used for memory remappings University of California San Diego
Conclusion (cont. ) n Locality phase detection should benefit n modern adaptation techniques for increasing performance n reducing energy n other improvements University of California San Diego
Questions? University of California San Diego
- Xipeng shen
- One way function
- Yutao zhong
- Chen chen berlin
- Irene zhong
- 1ren
- Shang wu
- Ta jiao hao
- Zhong shao
- Hao zhong
- Lai ba ying ye zhong
- Hao zhong
- Lee zhong sheng
- Zhong hanliang
- Stationary phase in gas chromatography
- In a ∆-connected source feeding a y-connected load
- Normal phase vs reverse phase chromatography
- Csce 441
- M tswett pronunciation
- Normal phase vs reverse phase chromatography
- Power formula three phase
- Mobile phase and stationary phase
- Detectors used in hplc
- Max shen
- Emily shen md
- Good locality
- Locality of reference in os
- Concrete example of locality development
- Chien-chung shen
- Locality of reference
- Shen dian
- Teknik mapping pada memori
- Nature of folk dance that shows imagery combat is
- Shen, wei-min
- Sketch all serious crime and crash scenes:
- Shen
- Sammy flood naked
- Locality of reference in os
- Spatial locality
- Principle of locality
- Fu shen massage