Presentation is loading. Please wait.

Presentation is loading. Please wait.

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos J Eliot B Moss Architecture and Language Implementation Lab University.

Similar presentations


Presentation on theme: "U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos J Eliot B Moss Architecture and Language Implementation Lab University."— Presentation transcript:

1 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos J Eliot B Moss Architecture and Language Implementation Lab University of Massachusetts, Amherst Inducing Heuristics To Decide Whether To Schedule

2 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 2 Motivation Instruction Scheduling is important Can improve running time by over 15% Can be expensive Frequently not beneficial Problem: Can we predict which blocks will benefit from scheduling?

3 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 3 Our Proposal Use static features to predict when instruction scheduling is beneficial Use supervised learning to construct a heuristic (filter) Simple features and learning scheme were successful! Could be harder for other optimizations

4 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 4 Optimization Filters 1.Decision process less expensive than OPT process 2.OPT process optional 3.OPT process not always be profitable

5 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 5 Traditional Heuristic Construction

6 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 6 Use Supervised Learning! Induces functions automatically All you need is learning examples a,…,x,y,z  label a,…,x,y,z are the features label (true or false) whether to schedule Minimize errors over training set Prefers less complicated function

7 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 7 Benefits of Supervised Learning Heuristic construction is sped up Determines relative importance of features Efficient and effective Good heuristic generated in minutes Guaranteed theoretically sound Traditional approach ad-hoc

8 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 8 Inducing a Filter for Instruction Scheduling Identify cheap-to-compute features of block Obtain raw training data for each block: Features (properties) of the block Estimated time with and without scheduling Use supervised learning to induce filter Rule Induction Install filter into compiler Controls which blocks to schedule

9 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 9 Properties of Block (Features) FeatureKindMeaning BBLenBlock SizeNumber of Instructions Branch, Call, Load, Store,Return OperationFraction of that type of instruction Integer, Float, System Functional UnitFraction of instructions that execute on that FU PEI, GC, Yield, Thread HazardFraction of that type of hazard instruction

10 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 10 Block Timing Estimator Estimate of cycles to execute block Simple model of real machine Determines cost of block in isolation Absolute cycle count not important Relative differences important

11 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 11 Labeling using Thresholds Positive = If Benefit greater than Threshold Negative = If Benefit less than or equal to 0 Neutral = If Benefit greater than 0 and less than Threshold

12 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 12 Motivation for Threshold Technique Simplify supervised learning problem Remove cases of fine distinction If a small benefit prefer not to schedule Remember: Scheduling is costly Apply scheduling if benefit above threshold.

13 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 13 Effectiveness with Filtering

14 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 14 Efficiency with Filtering

15 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 15 Cost of Evaluating Filters Threshold SBSIF/SF/CS/C t=016.8%36.3%6.5%0.7%10.3% t=516.1%36.9%6.3%0.7%10.3% t=1012.7%28.5%8.8%0.7%7.6% t=1511.2%23.3%9.3%0.6%6.7% t=208.3%20.5%9.8%0.6%6.2% t=259.2%21.0%10.3%0.7%6.3% SB=Scheduled Blocks, SI=Scheduled Instructions F=Heuristic Cost, S=Scheduling Cost, C=Compilation Cost * List Scheduling is 13% to 23% of total compilation time

16 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 16 Future Work with Optimization Filters Use a filter to control register allocation Graph Coloring Effective, but expensive Linear Scan Efficient, but not always as effective Heuristic decides which algorithm to apply

17 U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 17 Conclusion Optimization Filters are successful Reducing scheduling time by 75% Preserve 93% of scheduling benefit Use of supervised learning effective No previous “hand-coded” heuristic


Download ppt "U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos J Eliot B Moss Architecture and Language Implementation Lab University."

Similar presentations


Ads by Google