Title: John Cavazos
1Inducing Heuristics To Decide Whether To
Schedule
- John Cavazos
- J Eliot B Moss
- Architecture and Language Implementation Lab
- University of Massachusetts, Amherst
2Motivation
- 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?
3Our 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
4Optimization Filters
- Decision process less expensive than OPT process
- OPT process optional
- OPT process not always be profitable
5Traditional Heuristic Construction
6Use 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
7Benefits 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
8Inducing a Filterfor 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
9Properties of Block (Features)
Feature Kind Meaning
BBLen Block Size Number of Instructions
Branch, Call, Load, Store,Return Operation Fraction of that type of instruction
Integer, Float, System Functional Unit Fraction of instructions that execute on that FU
PEI, GC, Yield, Thread Hazard Fraction of that type of hazard instruction
10Block 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
11Labeling 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
12Motivation 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.
13Effectiveness with Filtering
14Efficiency with Filtering
15Cost of Evaluating Filters
Threshold SB SI F/S F/C S/C
t0 16.8 36.3 6.5 0.7 10.3
t5 16.1 36.9 6.3 0.7 10.3
t10 12.7 28.5 8.8 0.7 7.6
t15 11.2 23.3 9.3 0.6 6.7
t20 8.3 20.5 9.8 0.6 6.2
t25 9.2 21.0 10.3 0.7 6.3
SBScheduled Blocks, SIScheduled
Instructions FHeuristic Cost, SScheduling Cost,
CCompilation Cost List Scheduling is 13 to
23 of total compilation time
16Future Work withOptimization 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
17Conclusion
- Optimization Filters are successful
- Reducing scheduling time by 75
- Preserve 93 of scheduling benefit
- Use of supervised learning effective
- No previous hand-coded heuristic