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

Slides:



Advertisements
Similar presentations
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Three Challenges for Transactional Computing J. Eliot B. Moss Associate Professor,
Advertisements

Symbol Table.
Register Allocation Zach Ma.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Instruction Scheduling John Cavazos University.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Analysis of Algorithms CS Data Structures Section 2.6.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Rich Transactions on Reasonable Hardware J. Eliot B. Moss Univ. of Massachusetts,
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science The Implementation of the Cilk-5 Multithreaded Language (Frigo, Leiserson, and.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Mitigating the Compiler Optimization Phase- Ordering Problem using Machine Learning.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Leveraging Interleaved Signal Edges for Concurrent Backscatter by Pan Hu, Pengyu.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Operating Systems CMPSCI 377 Lecture 11: Memory Management
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Improving code generation. Better code generation requires greater context Over expressions: optimal ordering of subtrees Over basic blocks: Common subexpression.
Addressing Optimization for Loop Execution Targeting DSP with Auto-Increment/Decrement Architecture Wei-Kai Cheng Youn-Long Lin* Computer & Communications.
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science Quantifying the Benefits of Resource Multiplexing in On-Demand Data Centers Abhishek.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Code Generation for Basic Blocks Introduction Mooly Sagiv html:// Chapter
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science pH: A Parallel Dialect of Haskell Jim Cipar & Jacob Sorber University of Massachusetts.
U NIVERSITY OF M ASSACHUSETTS Department of Computer Science Automatic Heap Sizing Ting Yang, Matthew Hertz Emery Berger, Eliot Moss University of Massachusetts.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS, A MHERST D EPARTMENT OF C OMPUTER S CIENCE Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Csci4203/ece43631 Review Quiz. 1)It is less expensive 2)It is usually faster 3)Its average CPI is smaller 4)It allows a faster clock rate 5)It has a simpler.
From Cooper & Torczon1 Implications Must recognize legal (and illegal) programs Must generate correct code Must manage storage of all variables (and code)
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Optimal Fixed-Size Controllers for Decentralized POMDPs Christopher Amato Daniel.
Improving Code Generation Honors Compilers April 16 th 2002.
Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Improving code generation. Better code generation requires greater context Over expressions: optimal ordering of subtrees Over basic blocks: Common subexpression.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos Architecture and Language Implementation Lab Thesis Seminar University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Multilisp: Concurrent Functional Programming Ed Walters and Tim Richards University.
Introduction & Overview CS4533 from Cooper & Torczon.
CISC673 – Optimizing Compilers1/34 Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware Phase Ordering.
© Janice Regan, CMPT 128, Feb CMPT 128: Introduction to Computing Science for Engineering Students Running Time Big O Notation.
U NIVERSITY OF M ASSACHUSETTS, A MHERST D EPARTMENT OF C OMPUTER S CIENCE Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
1 Advance Computer Architecture CSE 8383 Ranya Alawadhi.
Meta Optimization Improving Compiler Heuristics with Machine Learning Mark Stephenson, Una-May O’Reilly, Martin Martin, and Saman Amarasinghe MIT Computer.
Dept. of Computer and Information Sciences : University of Delaware John Cavazos Department of Computer and Information Sciences University of Delaware.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Register Allocation John Cavazos University.
CMPE 511 Computer Architecture A Faster Optimal Register Allocator Betül Demiröz.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Concurrency Patterns Emery Berger and Mark Corner University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 Emery Berger University of Massachusetts,
Exploiting Context Analysis for Combining Multiple Entity Resolution Systems -Ramu Bandaru Zhaoqi Chen Dmitri V.kalashnikov Sharad Mehrotra.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger,
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science Performance of Work Stealing in Multiprogrammed Environments Matthew Hertz Department.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Fortress John Burgess and Richard Chang CS691W University of Massachusetts Amherst.
Advanced Computer Architecture Lab University of Michigan Compiler Controlled Value Prediction with Branch Predictor Based Confidence Eric Larson Compiler.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
Limits of Instruction-Level Parallelism Presentation by: Robert Duckles CSE 520 Paper being presented: Limits of Instruction-Level Parallelism David W.
CISC Machine Learning for Solving Systems Problems John Cavazos Dept of Computer & Information Sciences University of Delaware
Compiler Construction Dr. Naveed Ejaz Lecture 4. 2 The Back End Register Allocation:  Have each value in a register when it is used. Instruction selection.
OPTIMIZING DSP SCHEDULING VIA ADDRESS ASSIGNMENT WITH ARRAY AND LOOP TRANSFORMATION Chun Xue, Zili Shao, Ying Chen, Edwin H.-M. Sha Department of Computer.
A Memory-hierarchy Conscious and Self-tunable Sorting Library To appear in 2004 International Symposium on Code Generation and Optimization (CGO ’ 04)
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Synchronization Emery Berger and Mark Corner University.
The life of an instruction in EV6 pipeline Constantinos Kourouyiannis.
Machine Learning in Compiler Optimization By Namita Dave.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Intelligent Compilation John Cavazos Computer & Information Sciences Department.
Reinforcement Learning for Mapping Instructions to Actions S.R.K. Branavan, Harr Chen, Luke S. Zettlemoyer, Regina Barzilay Computer Science and Artificial.
Instruction Scheduling Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
CS203 – Advanced Computer Architecture
Closure Representations in Higher-Order Programming Languages
Charles Weems and Tim Richards University of Massachusetts Amherst
Presentation transcript:

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

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?

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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