Whole Program Paths James R. Larus. Outline 1. Find acyclic path fragments 2. Convert into whole-program path 3. Determine hot subpaths.

Slides:



Advertisements
Similar presentations
How SAS implements structured programming constructs
Advertisements

CHAPTER 2 ALGORITHM ANALYSIS 【 Definition 】 An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition,
Lecture 4 (week 2) Source Coding and Compression
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
Macro simple idea of textual substitution useful when you need a group of instructions or directives frequently.
Control Flow Analysis (Chapter 7) Mooly Sagiv (with Contributions by Hanne Riis Nielson)
Chapter 5 Syntax Directed Translation. Outline Syntax Directed Definitions Evaluation Orders of SDD’s Applications of Syntax Directed Translation Syntax.
Overview of Previous Lesson(s) Over View  Front end analyzes a source program and creates an intermediate representation from which the back end generates.
Programming recap. Do you know these? LOW LEVEL 1 st generation: machine language (110011) 2 nd generation: assembly language (ADD, SUB) HIGH LEVEL 3.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
Suffix Trees and Derived Applications Carl Bergenhem and Michael Smith.
SKELETON BASED PERFORMANCE PREDICTION ON SHARED NETWORKS Sukhdeep Sodhi Microsoft Corp Jaspal Subhlok University of Houston.
A Comparison of Online and Dynamic Impact Analysis Algorithms Ben Breech Mike Tegtmeyer Lori Pollock University of Delaware.
The Use of Program Profiling for Software Maintenance with Applications to the Year 2000 Problem Thomas Reps, Thomas Ball, Manuvir Das, and James Larus.
CS 536 Spring Intermediate Code. Local Optimizations. Lecture 22.
Improving Data-flow Analysis with Path Profiles ● Glenn Ammons & James R. Larus ● University of Wisconsin-Madison ● 1998 ● Presented by Jessica Friis.
Incremental Path Profiling Kevin Bierhoff and Laura Hiatt Path ProfilingIncremental ApproachExperimental Results Path profiling counts how often each path.
CHAPTER 2 ANALYSIS OF ALGORITHMS Part 2. 2 Running time of Basic operations Basic operations do not depend on the size of input, their running time is.
Intermediate Code. Local Optimizations
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex With code bases exceeding a million lines of code, a.
Genome Assembly Charles Yan Fragment Assembly Given a large number of fragments, such as ACC AC AT AC AT GG …, the goal is to figure out the original.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
1 Introduction to Parsing Lecture 5. 2 Outline Regular languages revisited Parser overview Context-free grammars (CFG’s) Derivations.
Data Structures Arrays both single and multiple dimensions Stacks Queues Trees Linked Lists.
Syntax Directed Translation. Syntax directed translation Yacc can do a simple kind of syntax directed translation from an input sentence to C code We.
Huffman Codes. Encoding messages  Encode a message composed of a string of characters  Codes used by computer systems  ASCII uses 8 bits per character.
Data Compression1 File Compression Huffman Tries ABRACADABRA
Dataflow Frequency Analysis based on Whole Program Paths Eduard Mehofer Institute for Software Science University of Vienna
CSc 453 Final Code Generation Saumya Debray The University of Arizona Tucson.
Compactly Representing Parallel Program Executions Ankit Goel Abhik Roychoudhury Tulika Mitra National University of Singapore.
A Decompression Architecture for Low Power Embedded Systems Lekatsas, H.; Henkel, J.; Wolf, W.; Computer Design, Proceedings International.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
Synopsys University Courseware Copyright © 2012 Synopsys, Inc. All rights reserved. Compiler Optimization and Code Generation Lecture - 1 Developed By:
1 Recursive Data Structure Profiling Easwaran Raman David I. August Princeton University.
Introduction to Parsing
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
`. Lecture Overview Structure Programming Basic Control of Structure Programming Selection Logical Operations Iteration Flowchart.
INFAnt: NFA Pattern Matching on GPGPU Devices Author: Niccolo’ Cascarano, Pierluigi Rolando, Fulvio Risso, Riccardo Sisto Publisher: ACM SIGCOMM 2010 Presenter:
Practical Path Profiling for Dynamic Optimizers Michael Bond, UT Austin Kathryn McKinley, UT Austin.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
File Systems cs550 Operating Systems David Monismith.
Interprocedural Path Profiling David Melski Thomas Reps University of Wisconsin.
Costas Busch - LSU1 Parsing. Costas Busch - LSU2 Compiler Program File v = 5; if (v>5) x = 12 + v; while (x !=3) { x = x - 3; v = 10; } Add v,v,5.
Oracle9i Developer: PL/SQL Programming Chapter 11 Performance Tuning.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
An Offline Approach for Whole-Program Paths Analysis using Suffix Arrays G. Pokam, F. Bodin.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
HUFFMAN CODES.
A Simple Syntax-Directed Translator
Chapter 5. Greedy Algorithms
Introduction to Parsing (adapted from CS 164 at Berkeley)
Online Subpath Profiling
More Graph Algorithms.
Graph & BFS.
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Efficient Document Analytics on Compressed Data: Method, Challenges, Algorithms, Insights Feng Zhang †⋄, Jidong Zhai ⋄, Xipeng Shen #, Onur Mutlu ⋆, Wenguang.
Chapter 11 Data Compression
Parsing Costas Busch - LSU.
N-Gram Model Formulas Word sequences Chain rule of probability
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
` Structured Programming & Flowchart
Efficient Document Analytics on Compressed Data:
Compiler design.
CSE 373 Data Structures and Algorithms
rePLay: A Hardware Framework for Dynamic Optimization
CSE 373: Data Structures and Algorithms
WJEC GCSE Computer Science
Algorithms CSCI 235, Spring 2019 Lecture 31 Huffman Codes
Error Correction Coding
Presentation transcript:

Whole Program Paths James R. Larus

Outline 1. Find acyclic path fragments 2. Convert into whole-program path 3. Determine hot subpaths

Acyclic Paths As per Ball&Larus paper we implemented

Calculating Acyclic Paths Instrument chords Sum along paths is unique –Postprocess for functions Loop iter is new path –New: also function calls Dump path ID to file

Acyclic Paths Output

Outline 1. Find acyclic path fragments 2. Convert into whole-program path 1.Compress output string 2.Coalesce common substrings 3.Store efficiently 3. Determine hot subpaths

Compress and Coalesce

Grammatical Benefits Explain output string as context-free grammar: –Efficient compression (~20x) –Automatic subsequence grouping Grammar creation –Append symbols to start rule –Digrams appear at most once –Rules must be used at least twice Example:

SEQUITUR

Execution Representation Not a control-flow graph! Execution sequence = post-order traversal of DAG

Whole Paths Efficient representation –Create grammar online Execution context information –e.g., A runs after B Frequency information Simple path aggregation

Outline 1. Find acyclic path fragments 2. Convert into whole-program path 3. Determine hot subpaths 1.Find short frequent subsequences 2.??? 3.Profit!

Outline 1. Find acyclic path fragments 2. Convert into whole-program path 3. Determine hot subpaths 1.Find short frequent subsequences 2.Heavily optimize that 1% 3.Applies to 75% of cache misses

Hot Subpaths Looking for minimal hot subpaths –L or fewer consecutive acyclic path fragments with cost of C or greater –Cost = execution frequency x costs of acyclic path fragments –Path fragment cost = number of instructions

Finding Hot Subpaths Recursively look for hot minimal subpaths 1.Split between children 2.Processed at lower recursive level

Results Typically: –30MB/sec program trace –1 MB/sec program path –30 grammar rules per path fragment –100,000 rules in grammar Number of hot paths grows slowly with maximum length Space sublinear in input size, time supralinear

Results

Results Typically: –30MB/sec program trace –1 MB/sec program path –30 grammar rules per path fragment –100,000 rules in grammar Number of hot paths grows slowly with maximum length Space sublinear in input size, time supralinear

Results

Summary Contributions –Stream out acyclic path fragments in order –Compress and structure with grammar –Find hot subpaths from whole program path Limitations –15x runtime slowdown –Space-based limits on runtime –High number of hot paths found

Questions What other potentially-useful information does this data structure give? –Order-dependent code errors What potential for optimization does this open up? –Other applications? –Experimental hot-path results?