Legal and impossible dependences

Size: px
Start display at page:

Download "Legal and impossible dependences"

Transcription

1 Transformations and Dependences 1

2 operations, column Fourier-Motzkin elimination us use these tools to determine (i) legality of permutation and Let generation of transformed code. (ii) Recall: Polyhedral algebra tools for determining emptiness of convex polyhedra enumerating integers in such a polyhedron. Central ideas: reduction of matrices to echelon form by unimodular 2

3 Dependence relation

4 Legal and impossible dependences

5 Distance vectors

6 Distance vectors

7 Computing distance vectors

8 Distance vectors: 2D loop nest

9 Direction vectors

10 Direction vectors for nested loops

11 Example

12 Example (contd.)

13 Example (contd.)

14 Dependence matrix

15 Loop permutation can be modeled as a linear transformation on iteration space: J V 0 1 I = U 1 0 J V DO I = 1, N DO U = 1, N DO J = I,N DO V = 1,U X(I,J) = 5 I X(V,U) = 5 U Permutation of loops in n-loop nest: nxn permutation matrix P P I = U Questions: (1) How do we generate new loop bounds? (2) How do we modify the loop body? (3) How do we know when loop interchange is legal? 4

16 J V I U DO I = 1, N 0 1 I = U DO U = 1, N DO J = I,N 1 0 J V DO V = 1,U I1 J1 I2 J2 T I1 J1 T I2 J2 Dependence distance = I2 - I1 J2 - J1 Distance between iterations = I2 T - T I1 = T J2 J1 I2 - I1 J2 - J1 = J2 - J1 I2 - I1 Check for legality: interchange positions in distance/direction vector check for lex +ve If transformation P is legal and original dependence matrix is D, new dependence matrix is T*D. 47

17 Transformation matrix: T Dependence matrix of transformed program: T:D Correctness of general permutation matrix: D Dependence in which each column is a distance/direction vector Matrix Legality: T:D 0 48

18 Examples: DO I = 1,N DO J = 1,N X(I,J) = X(I-1,J-1)... Distance vector = (1,1) => permutation is legal Dependence vector of transformed program = (1,1) DO I = 1,N DO J = 1,N X(I,J) = X(I-1,J+1)... Distance vector = (1,-1) => permutation is not legal 49

19 Transformation: U = T I for loop permutation, T is a permutation matrix Note: inverse is integer matrix => So bounds on U can be written as A T ;1 U b Fourier-Motzkin elimination on this system of Perform to obtain bounds on U. inequalities Code Generation for Transformed Loop Nest Two problems: (1) Loop bounds (2) Change of variables in body (1) New bounds: Original bounds: A I b where A is in echelon form (2) Change of variables: I = T ;1 U Replace old variables by new using this formula 5

20 Example: J V I U 0 1 I = U 1 0 J V DO I = 1, N DO U = 1, N DO J = I,N DO V = 1,U X(I,J) = 5 X(V,U) = 5 Fourier-Motzkin elimination -1 0 I < J N N U V < -1 N 0 N 6

21 U V < -1 N 0 N U V < -1 N 0 N Projecting out V from system gives 1 < U < N Bounds for V are 1 < V < min(u,n) These are loop bounds given by FM elimination. With a little extra work, we can simplify the upper bound of V to U. 7

22 maxs in lower bounds and mins in upper bounds. with No need for pattern matching etc for triangular bounds and the Key points: Loop bounds determination in transformed code is mechanical. Polyhedral algebra technology can handle very general bounds like. 8

23 for permutations applies to other loop transformations that Theory be modeled as linear transformations: skewing, reversal,scaling. can Dependence matrix of transformed program: T:D Transformation matrix: T (a non-singular matrix) matrix: D Dependence in which each column is a distance/direction vector Matrix Legality: T:D 0 Small complication with code generation if scaling is included. 3

24 between two iterations Dependence iterations touch the same location => J I Motivating example: Wavefront code DO I = 1,N DO J = 1,N X(I,J) = X(I-1,J+1)... Dependence matrix = 1-1 => potential for exploiting data reuse! iteration points between executions of dependent iterations. N we schedule dependent iterations closer together? Can 8

25 now, focus only on reuse opportunities between dependent For iterations. iterations that read from the same location: input dependences spatial locality This exploits only one kind of temporal locality. There are other kinds of locality that are important: Both are easy to add to basic model as we will see later. 9

26 J Exploiting temporal locality in wavefront I J I Permutation is illegal! Tiling is illegal! We have studied two transformations: permutation and tiling. Permutation and tiling are both illegal. 10

27 Height Reduction 11

28 Transformation is legal. Dependent iterations are scheduled close together, so good for J H One solution: schedule iterations along 45 degree planes! I G Note: locality. Can we view this in terms of loop transformation? Loop skewing followed by loop reversal. 12

29 Loop Skewing: a linear loop transformation J V I J = U V Skewing of inner loop by outer loop: I 1 0 k 1 U (k is some fixed integer) Skewing of inner loop by an outer loop: always legal New dependence vectors: compute T*D 1 In this example, D = T*D = This skewing has changed dependence vector but it has not brought dependent iterations closer together... 13

30 Skewing outer loop by inner loop J V I U I J = U V Outer loop skewing: 1 k 0 1 Skewing of outer loop by inner loop: not necessarily legal In this example, D = 1 T*D = 0 incorrect -1-1 Dependent iterations are closer together (good) but program is illegal (bad). How do we fix this?? 14

31 5-5 Loop Reversal:a linear loop transformation 0 I U 0 U = [-1][I] DO I = 1, N DO U = -N,-1 X(I) = I+2 X(-U) = -U +2 Transformation matrix = [-1] Another example: 2-D loop, reverse inner loop U V = I J Legality of loop reversal: Apply transformation matrix to all dependences verify lex +ve Code generation: easy 15

32 Need for composite transformations J V I J = U V I U Transformation: skewing followed by reversal In final program, dependent iterations are close together! Composition of linear transformations = another linear transformation! Composite transformation matrix is H U V = G H G * = How do we synthesize this composite transformation?? 16

33 Transformation matrices for permutation/reversal/skewing are unimodular. Any composition of these transformations can be represented a unimodular matrix. by Any unimodular matrix can be decomposed into product of matrices. permutation/reversal/skewing Legality of composite transformation T : check that T:D 0. T 3 (T 2 (T 1 D)) = (T 3 T 2 T 1 ) D.) (Proof: Code generation algorithm: New bounds: compute from A T ;1 U b Some facts about permutation/reversal/skewing Original bounds: A I b Transformation: U = T I 17

34 composite transformations using matrix-based Synthesizing approaches Rather than reason about sequences of transformations, we can about the single matrix that represents the composite reason transformation. Enabling abstraction: dependence matrix 18

35 Height reduction: move reuse into inner loops! 1. Dependence vector is ;1 Prefer not to have dependent iterations in dierent outer loop iterations.! 0 So dependence vector in transformed program should look like.??!! 1 0 So T = ;1??! 1 This says rst row of T is orthogonal to. ;1 So rst row of T can be chosen to be (1 1). What about second row? 19

36 s should be linearly independent of rst row of T (non-singular matrix). T D should be a lexicographically positive vector. Determinant of matrix should be +1 or -1 (unimodularity). Second row of T (call it s) should satisfy the following properties:! 1 1 One choice: (0 ; 1), giving T =. 0 ;1 20

37 How do we choose the rst few rows of the transformation 1. to push reuses down? matrix How do we ll in the rest of the matrix to get unimodular 2. matrix? General questions 21

38 Linear loop transformations to enable tiling 50

39 is legal if loops are fully permutable (all permutations of Tiling are legal). loops Can we always convert a perfectly nested loop into a fully loop nest? permutable When we can, how do we do it? J In general, tiling is not legal D = I Tiling is illegal! Tiling is legal if all entries in dependence matrix are non-negative. 51

40 If all dependence vectors are distance vectors, we can Theorem: entire loop nest into a fully permutable loop nest. 1 ;1 A. matrix of transformed program must have all positive Dependence entries. rst row of transformation can be (1 0). So row of transformation (m 1) (for any m > 0). Second idea: skew inner loops by outer loops suciently to make General negative entries non-negative. all Example: wavefront 0 1 Dependence matrix is 52

41 to make rst row with negative entries into row Transformation non-negative entries with p2... p m -n p3... -k row a row b first row with negative entries (a) for each negative entry in the first row with negative entries, find the first positive number in the corresponding column assume the rows for these positive entries are a,b etc as shown above (b) skew the row with negative entries by appropriate multiples of rows a,b... For our example, multiple of row a = ceiling(n/p2) multiple of row b = ceiling(max(m/p1,k/p3)) Transformation: I ceiling(n/p2) 0 0 ceiling(max(m/p1,k/p3))0...0 I 53

42 all entries in dependence matrix are non-negative, done. If Otherwise, Apply algorithm on previous slide to rst row with 1. entries. non-negative Generate new dependence matrix. 2. If no negative entries, done. 3. General algorithm for making loop nest fully permutable: 4. Otherwise, go step (1). 54

43 as nice as height reduction solution, but it will work ne for Not enhancement except at tile boundaries (but boundary locality J I J I Result of tiling transformed wavefront Original loop Tiled fully permutable loop Tiling generates a 4-deep loop nest. points small compared to number of interior points). 55

Linear Loop Transformations for Locality Enhancement

Linear Loop Transformations for Locality Enhancement Linear Loop Transformations for Locality Enhancement 1 Story so far Cache performance can be improved by tiling and permutation Permutation of perfectly nested loop can be modeled as a linear transformation

More information

Null space basis: mxz. zxz I

Null space basis: mxz. zxz I Loop Transformations Linear Locality Enhancement for ache performance can be improved by tiling and permutation Permutation of perfectly nested loop can be modeled as a matrix of the loop nest. dependence

More information

Loop Transformations, Dependences, and Parallelization

Loop Transformations, Dependences, and Parallelization Loop Transformations, Dependences, and Parallelization Announcements HW3 is due Wednesday February 15th Today HW3 intro Unimodular framework rehash with edits Skewing Smith-Waterman (the fix is in!), composing

More information

Tiling: A Data Locality Optimizing Algorithm

Tiling: A Data Locality Optimizing Algorithm Tiling: A Data Locality Optimizing Algorithm Announcements Monday November 28th, Dr. Sanjay Rajopadhye is talking at BMAC Friday December 2nd, Dr. Sanjay Rajopadhye will be leading CS553 Last Monday Kelly

More information

Systems of Inequalities

Systems of Inequalities Systems of Inequalities 1 Goals: Given system of inequalities of the form Ax b determine if system has an integer solution enumerate all integer solutions 2 Running example: Upper bounds for x: (2)and

More information

The Polyhedral Model (Transformations)

The Polyhedral Model (Transformations) The Polyhedral Model (Transformations) Announcements HW4 is due Wednesday February 22 th Project proposal is due NEXT Friday, extension so that example with tool is possible (see resources website for

More information

Review. Loop Fusion Example

Review. Loop Fusion Example Review Distance vectors Concisely represent dependences in loops (i.e., in iteration spaces) Dictate what transformations are legal e.g., Permutation and parallelization Legality A dependence vector is

More information

Tiling: A Data Locality Optimizing Algorithm

Tiling: A Data Locality Optimizing Algorithm Tiling: A Data Locality Optimizing Algorithm Previously Unroll and Jam Homework PA3 is due Monday November 2nd Today Unroll and Jam is tiling Code generation for fixed-sized tiles Paper writing and critique

More information

LARGE SCALE LINEAR AND INTEGER OPTIMIZATION: A UNIFIED APPROACH

LARGE SCALE LINEAR AND INTEGER OPTIMIZATION: A UNIFIED APPROACH LARGE SCALE LINEAR AND INTEGER OPTIMIZATION: A UNIFIED APPROACH Richard Kipp Martin Graduate School of Business University of Chicago % Kluwer Academic Publishers Boston/Dordrecht/London CONTENTS Preface

More information

Chapter 4 Concepts from Geometry

Chapter 4 Concepts from Geometry Chapter 4 Concepts from Geometry An Introduction to Optimization Spring, 2014 Wei-Ta Chu 1 Line Segments The line segment between two points and in R n is the set of points on the straight line joining

More information

CS671 Parallel Programming in the Many-Core Era

CS671 Parallel Programming in the Many-Core Era 1 CS671 Parallel Programming in the Many-Core Era Polyhedral Framework for Compilation: Polyhedral Model Representation, Data Dependence Analysis, Scheduling and Data Locality Optimizations December 3,

More information

Data Dependences and Parallelization

Data Dependences and Parallelization Data Dependences and Parallelization 1 Agenda Introduction Single Loop Nested Loops Data Dependence Analysis 2 Motivation DOALL loops: loops whose iterations can execute in parallel for i = 11, 20 a[i]

More information

CS 293S Parallelism and Dependence Theory

CS 293S Parallelism and Dependence Theory CS 293S Parallelism and Dependence Theory Yufei Ding Reference Book: Optimizing Compilers for Modern Architecture by Allen & Kennedy Slides adapted from Louis-Noël Pouche, Mary Hall End of Moore's Law

More information

Lesson 17. Geometry and Algebra of Corner Points

Lesson 17. Geometry and Algebra of Corner Points SA305 Linear Programming Spring 2016 Asst. Prof. Nelson Uhan 0 Warm up Lesson 17. Geometry and Algebra of Corner Points Example 1. Consider the system of equations 3 + 7x 3 = 17 + 5 = 1 2 + 11x 3 = 24

More information

Principle of Polyhedral model for loop optimization. cschen 陳鍾樞

Principle of Polyhedral model for loop optimization. cschen 陳鍾樞 Principle of Polyhedral model for loop optimization cschen 陳鍾樞 Outline Abstract model Affine expression, Polygon space Polyhedron space, Affine Accesses Data reuse Data locality Tiling Space partition

More information

Computing and Informatics, Vol. 36, 2017, , doi: /cai

Computing and Informatics, Vol. 36, 2017, , doi: /cai Computing and Informatics, Vol. 36, 2017, 566 596, doi: 10.4149/cai 2017 3 566 NESTED-LOOPS TILING FOR PARALLELIZATION AND LOCALITY OPTIMIZATION Saeed Parsa, Mohammad Hamzei Department of Computer Engineering

More information

The Challenges of Non-linear Parameters and Variables in Automatic Loop Parallelisation

The Challenges of Non-linear Parameters and Variables in Automatic Loop Parallelisation The Challenges of Non-linear Parameters and Variables in Automatic Loop Parallelisation Armin Größlinger December 2, 2009 Rigorosum Fakultät für Informatik und Mathematik Universität Passau Automatic Loop

More information

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity Marc Uetz University of Twente m.uetz@utwente.nl Lecture 5: sheet 1 / 26 Marc Uetz Discrete Optimization Outline 1 Min-Cost Flows

More information

Computing the Integer Points of a Polyhedron

Computing the Integer Points of a Polyhedron Computing the Integer Points of a Polyhedron Complexity Estimates Rui-Juan Jing 1,2 and Marc Moreno Maza 2,3 1 Key Laboratoty of Mathematics Mechnization, Academy of Mathematics and Systems Science, Chinese

More information

A Crash Course in Compilers for Parallel Computing. Mary Hall Fall, L2: Transforms, Reuse, Locality

A Crash Course in Compilers for Parallel Computing. Mary Hall Fall, L2: Transforms, Reuse, Locality A Crash Course in Compilers for Parallel Computing Mary Hall Fall, 2008 1 Overview of Crash Course L1: Data Dependence Analysis and Parallelization (Oct. 30) L2 & L3: Loop Reordering Transformations, Reuse

More information

6.189 IAP Lecture 11. Parallelizing Compilers. Prof. Saman Amarasinghe, MIT IAP 2007 MIT

6.189 IAP Lecture 11. Parallelizing Compilers. Prof. Saman Amarasinghe, MIT IAP 2007 MIT 6.189 IAP 2007 Lecture 11 Parallelizing Compilers 1 6.189 IAP 2007 MIT Outline Parallel Execution Parallelizing Compilers Dependence Analysis Increasing Parallelization Opportunities Generation of Parallel

More information

Investigating Mixed-Integer Hulls using a MIP-Solver

Investigating Mixed-Integer Hulls using a MIP-Solver Investigating Mixed-Integer Hulls using a MIP-Solver Matthias Walter Otto-von-Guericke Universität Magdeburg Joint work with Volker Kaibel (OvGU) Aussois Combinatorial Optimization Workshop 2015 Outline

More information

Iterative Optimization in the Polyhedral Model: Part I, One-Dimensional Time

Iterative Optimization in the Polyhedral Model: Part I, One-Dimensional Time Iterative Optimization in the Polyhedral Model: Part I, One-Dimensional Time Louis-Noël Pouchet, Cédric Bastoul, Albert Cohen and Nicolas Vasilache ALCHEMY, INRIA Futurs / University of Paris-Sud XI March

More information

Linear Equations in Linear Algebra

Linear Equations in Linear Algebra 1 Linear Equations in Linear Algebra 1.2 Row Reduction and Echelon Forms ECHELON FORM A rectangular matrix is in echelon form (or row echelon form) if it has the following three properties: 1. All nonzero

More information

Catalan Numbers. Table 1: Balanced Parentheses

Catalan Numbers. Table 1: Balanced Parentheses Catalan Numbers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 00 We begin with a set of problems that will be shown to be completely equivalent. The solution to each problem

More information

Linear Programming in Small Dimensions

Linear Programming in Small Dimensions Linear Programming in Small Dimensions Lekcija 7 sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Edited from slides by Antoine Vigneron Outline linear programming, motivation and definition one dimensional

More information

Integer Programming Theory

Integer Programming Theory Integer Programming Theory Laura Galli October 24, 2016 In the following we assume all functions are linear, hence we often drop the term linear. In discrete optimization, we seek to find a solution x

More information

Transforming Imperfectly Nested Loops

Transforming Imperfectly Nested Loops Transforming Imperfectly Nested Loops 1 Classes of loop transformations: Iteration re-numbering: (eg) loop interchange Example DO 10 J = 1,100 DO 10 I = 1,100 DO 10 I = 1,100 vs DO 10 J = 1,100 Y(I) =

More information

Control flow graphs and loop optimizations. Thursday, October 24, 13

Control flow graphs and loop optimizations. Thursday, October 24, 13 Control flow graphs and loop optimizations Agenda Building control flow graphs Low level loop optimizations Code motion Strength reduction Unrolling High level loop optimizations Loop fusion Loop interchange

More information

Linear programming and duality theory

Linear programming and duality theory Linear programming and duality theory Complements of Operations Research Giovanni Righini Linear Programming (LP) A linear program is defined by linear constraints, a linear objective function. Its variables

More information

Autotuning. John Cavazos. University of Delaware UNIVERSITY OF DELAWARE COMPUTER & INFORMATION SCIENCES DEPARTMENT

Autotuning. John Cavazos. University of Delaware UNIVERSITY OF DELAWARE COMPUTER & INFORMATION SCIENCES DEPARTMENT Autotuning John Cavazos University of Delaware What is Autotuning? Searching for the best code parameters, code transformations, system configuration settings, etc. Search can be Quasi-intelligent: genetic

More information

Performing Matrix Operations on the TI-83/84

Performing Matrix Operations on the TI-83/84 Page1 Performing Matrix Operations on the TI-83/84 While the layout of most TI-83/84 models are basically the same, of the things that can be different, one of those is the location of the Matrix key.

More information

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension Antoine Vigneron King Abdullah University of Science and Technology November 7, 2012 Antoine Vigneron (KAUST) CS 372 Lecture

More information

Dual-fitting analysis of Greedy for Set Cover

Dual-fitting analysis of Greedy for Set Cover Dual-fitting analysis of Greedy for Set Cover We showed earlier that the greedy algorithm for set cover gives a H n approximation We will show that greedy produces a solution of cost at most H n OPT LP

More information

Lecture Notes on Loop Transformations for Cache Optimization

Lecture Notes on Loop Transformations for Cache Optimization Lecture Notes on Loop Transformations for Cache Optimization 5-: Compiler Design André Platzer Lecture Introduction In this lecture we consider loop transformations that can be used for cache optimization.

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Data-centric Transformations for Locality Enhancement

Data-centric Transformations for Locality Enhancement Data-centric Transformations for Locality Enhancement Induprakas Kodukula Keshav Pingali September 26, 2002 Abstract On modern computers, the performance of programs is often limited by memory latency

More information

Polyhedral Compilation Foundations

Polyhedral Compilation Foundations Polyhedral Compilation Foundations Louis-Noël Pouchet pouchet@cse.ohio-state.edu Dept. of Computer Science and Engineering, the Ohio State University Feb 15, 2010 888.11, Class #4 Introduction: Polyhedral

More information

4 Integer Linear Programming (ILP)

4 Integer Linear Programming (ILP) TDA6/DIT37 DISCRETE OPTIMIZATION 17 PERIOD 3 WEEK III 4 Integer Linear Programg (ILP) 14 An integer linear program, ILP for short, has the same form as a linear program (LP). The only difference is that

More information

Loop Transformations! Part II!

Loop Transformations! Part II! Lecture 9! Loop Transformations! Part II! John Cavazos! Dept of Computer & Information Sciences! University of Delaware! www.cis.udel.edu/~cavazos/cisc879! Loop Unswitching Hoist invariant control-flow

More information

THEORY OF LINEAR AND INTEGER PROGRAMMING

THEORY OF LINEAR AND INTEGER PROGRAMMING THEORY OF LINEAR AND INTEGER PROGRAMMING ALEXANDER SCHRIJVER Centrum voor Wiskunde en Informatica, Amsterdam A Wiley-Inter science Publication JOHN WILEY & SONS^ Chichester New York Weinheim Brisbane Singapore

More information

The Polyhedral Model (Dependences and Transformations)

The Polyhedral Model (Dependences and Transformations) The Polyhedral Model (Dependences and Transformations) Announcements HW3 is due Wednesday February 15 th, tomorrow Project proposal is due NEXT Friday, extension so that example with tool is possible Today

More information

A Loop Transformation Theory and an Algorithm to Maximize Parallelism

A Loop Transformation Theory and an Algorithm to Maximize Parallelism 452 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 2, NO. 4, OCTOBER 1991 A Loop Transformation Theory and an Algorithm to Maximize Parallelism Michael E. Wolf and Monica S. Lam, Member, IEEE

More information

Computational Methods CMSC/AMSC/MAPL 460. Vectors, Matrices, Linear Systems, LU Decomposition, Ramani Duraiswami, Dept. of Computer Science

Computational Methods CMSC/AMSC/MAPL 460. Vectors, Matrices, Linear Systems, LU Decomposition, Ramani Duraiswami, Dept. of Computer Science Computational Methods CMSC/AMSC/MAPL 460 Vectors, Matrices, Linear Systems, LU Decomposition, Ramani Duraiswami, Dept. of Computer Science Zero elements of first column below 1 st row multiplying 1 st

More information

A Layout-Conscious Iteration Space Transformation Technique

A Layout-Conscious Iteration Space Transformation Technique IEEE TRANSACTIONS ON COMPUTERS, VOL 50, NO 12, DECEMBER 2001 1321 A Layout-Conscious Iteration Space Transformation Technique Mahmut Kandemir, Member, IEEE, J Ramanujam, Member, IEEE, Alok Choudhary, Senior

More information

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini DM545 Linear and Integer Programming Lecture 2 The Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline 1. 2. 3. 4. Standard Form Basic Feasible Solutions

More information

Communication-Minimal Tiling of Uniform Dependence Loops

Communication-Minimal Tiling of Uniform Dependence Loops Communication-Minimal Tiling of Uniform Dependence Loops Jingling Xue Department of Mathematics, Statistics and Computing Science University of New England, Armidale 2351, Australia Abstract. Tiling is

More information

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if POLYHEDRAL GEOMETRY Mathematical Programming Niels Lauritzen 7.9.2007 Convex functions and sets Recall that a subset C R n is convex if {λx + (1 λ)y 0 λ 1} C for every x, y C and 0 λ 1. A function f :

More information

Lecture 2 Convex Sets

Lecture 2 Convex Sets Optimization Theory and Applications Lecture 2 Convex Sets Prof. Chun-Hung Liu Dept. of Electrical and Computer Engineering National Chiao Tung University Fall 2016 2016/9/29 Lecture 2: Convex Sets 1 Outline

More information

Tiling: A Data Locality Optimizing Algorithm

Tiling: A Data Locality Optimizing Algorithm Tiling: A Data Locality Optimizing Algorithm Previously Performance analysis of existing codes Data dependence analysis for detecting parallelism Specifying transformations using frameworks Today Usefulness

More information

Outline. Why Parallelism Parallel Execution Parallelizing Compilers Dependence Analysis Increasing Parallelization Opportunities

Outline. Why Parallelism Parallel Execution Parallelizing Compilers Dependence Analysis Increasing Parallelization Opportunities Parallelization Outline Why Parallelism Parallel Execution Parallelizing Compilers Dependence Analysis Increasing Parallelization Opportunities Moore s Law From Hennessy and Patterson, Computer Architecture:

More information

R & G Chapter 13. Implementation of single Relational Operations Choices depend on indexes, memory, stats, Joins Blocked nested loops:

R & G Chapter 13. Implementation of single Relational Operations Choices depend on indexes, memory, stats, Joins Blocked nested loops: Relational Query Optimization R & G Chapter 13 Review Implementation of single Relational Operations Choices depend on indexes, memory, stats, Joins Blocked nested loops: simple, exploits extra memory

More information

Polyhedral Operations. Algorithms needed for automation. Logistics

Polyhedral Operations. Algorithms needed for automation. Logistics Polyhedral Operations Logistics Intermediate reports late deadline is Friday March 30 at midnight HW6 (posted) and HW7 (posted) due April 5 th Tuesday April 4 th, help session during class with Manaf,

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra Probably the simplest kind of problem. Occurs in many contexts, often as part of larger problem. Symbolic manipulation packages can do linear algebra "analytically" (e.g. Mathematica,

More information

15.082J and 6.855J. Lagrangian Relaxation 2 Algorithms Application to LPs

15.082J and 6.855J. Lagrangian Relaxation 2 Algorithms Application to LPs 15.082J and 6.855J Lagrangian Relaxation 2 Algorithms Application to LPs 1 The Constrained Shortest Path Problem (1,10) 2 (1,1) 4 (2,3) (1,7) 1 (10,3) (1,2) (10,1) (5,7) 3 (12,3) 5 (2,2) 6 Find the shortest

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #16 Loops: Matrix Using Nested for Loop In this section, we will use the, for loop to code of the matrix problem.

More information

1 Inference for Boolean theories

1 Inference for Boolean theories Scribe notes on the class discussion on consistency methods for boolean theories, row convex constraints and linear inequalities (Section 8.3 to 8.6) Speaker: Eric Moss Scribe: Anagh Lal Corrector: Chen

More information

Lecture 9 Basic Parallelization

Lecture 9 Basic Parallelization Lecture 9 Basic Parallelization I. Introduction II. Data Dependence Analysis III. Loop Nests + Locality IV. Interprocedural Parallelization Chapter 11.1-11.1.4 CS243: Parallelization 1 Machine Learning

More information

Lecture 9 Basic Parallelization

Lecture 9 Basic Parallelization Lecture 9 Basic Parallelization I. Introduction II. Data Dependence Analysis III. Loop Nests + Locality IV. Interprocedural Parallelization Chapter 11.1-11.1.4 CS243: Parallelization 1 Machine Learning

More information

Parallelization. Saman Amarasinghe. Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

Parallelization. Saman Amarasinghe. Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Spring 2 Parallelization Saman Amarasinghe Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Outline Why Parallelism Parallel Execution Parallelizing Compilers

More information

Unconstrained Optimization

Unconstrained Optimization Unconstrained Optimization Joshua Wilde, revised by Isabel Tecu, Takeshi Suzuki and María José Boccardi August 13, 2013 1 Denitions Economics is a science of optima We maximize utility functions, minimize

More information

60 2 Convex sets. {x a T x b} {x ã T x b}

60 2 Convex sets. {x a T x b} {x ã T x b} 60 2 Convex sets Exercises Definition of convexity 21 Let C R n be a convex set, with x 1,, x k C, and let θ 1,, θ k R satisfy θ i 0, θ 1 + + θ k = 1 Show that θ 1x 1 + + θ k x k C (The definition of convexity

More information

LARP / 2018 ACK : 1. Linear Algebra and Its Applications - Gilbert Strang 2. Autar Kaw, Transforming Numerical Methods Education for STEM Graduates

LARP / 2018 ACK : 1. Linear Algebra and Its Applications - Gilbert Strang 2. Autar Kaw, Transforming Numerical Methods Education for STEM Graduates Triangular Factors and Row Exchanges LARP / 28 ACK :. Linear Algebra and Its Applications - Gilbert Strang 2. Autar Kaw, Transforming Numerical Methods Education for STEM Graduates Then there were three

More information

Compiling for Advanced Architectures

Compiling for Advanced Architectures Compiling for Advanced Architectures In this lecture, we will concentrate on compilation issues for compiling scientific codes Typically, scientific codes Use arrays as their main data structures Have

More information

1.5 Part - 2 Inverse Relations and Inverse Functions

1.5 Part - 2 Inverse Relations and Inverse Functions 1.5 Part - 2 Inverse Relations and Inverse Functions What happens when we reverse the coordinates of all the ordered pairs in a relation? We obviously get another relation, but does it have any similarities

More information

Polytopes Course Notes

Polytopes Course Notes Polytopes Course Notes Carl W. Lee Department of Mathematics University of Kentucky Lexington, KY 40506 lee@ms.uky.edu Fall 2013 i Contents 1 Polytopes 1 1.1 Convex Combinations and V-Polytopes.....................

More information

Week 7 Convex Hulls in 3D

Week 7 Convex Hulls in 3D 1 Week 7 Convex Hulls in 3D 2 Polyhedra A polyhedron is the natural generalization of a 2D polygon to 3D 3 Closed Polyhedral Surface A closed polyhedral surface is a finite set of interior disjoint polygons

More information

Matching and Planarity

Matching and Planarity Matching and Planarity Po-Shen Loh June 010 1 Warm-up 1. (Bondy 1.5.9.) There are n points in the plane such that every pair of points has distance 1. Show that there are at most n (unordered) pairs of

More information

Gelfand-Tsetlin Polytopes

Gelfand-Tsetlin Polytopes Gelfand-Tsetlin Polytopes Per Alexandersson, September 2014 Based on Gelfand-Tsetlin patterns, integrally closedness and compressed polytopes, arxiv:1405.4718 Skew Gelfand-Tsetlin patterns A Gelfand-Tsetlin

More information

Tilings of the Euclidean plane

Tilings of the Euclidean plane Tilings of the Euclidean plane Yan Der, Robin, Cécile January 9, 2017 Abstract This document gives a quick overview of a eld of mathematics which lies in the intersection of geometry and algebra : tilings.

More information

Probabilistic Graphical Models

Probabilistic Graphical Models School of Computer Science Probabilistic Graphical Models Theory of Variational Inference: Inner and Outer Approximation Eric Xing Lecture 14, February 29, 2016 Reading: W & J Book Chapters Eric Xing @

More information

Fourier-Motzkin and Farkas Questions (HW10)

Fourier-Motzkin and Farkas Questions (HW10) Automating Scheduling Logistics Final report for project due this Friday, 5/4/12 Quiz 4 due this Monday, 5/7/12 Poster session Thursday May 10 from 2-4pm Distance students need to contact me to set up

More information

Mathematical Programming and Research Methods (Part II)

Mathematical Programming and Research Methods (Part II) Mathematical Programming and Research Methods (Part II) 4. Convexity and Optimization Massimiliano Pontil (based on previous lecture by Andreas Argyriou) 1 Today s Plan Convex sets and functions Types

More information

The Simplex Algorithm

The Simplex Algorithm The Simplex Algorithm Uri Feige November 2011 1 The simplex algorithm The simplex algorithm was designed by Danzig in 1947. This write-up presents the main ideas involved. It is a slight update (mostly

More information

Math 1B03/1ZC3 - Tutorial 3. Jan. 24th/28th, 2014

Math 1B03/1ZC3 - Tutorial 3. Jan. 24th/28th, 2014 Math 1B03/1ZC3 - Tutorial 3 Jan. 24th/28th, 2014 Tutorial Info: Website: http://ms.mcmaster.ca/ dedieula. Math Help Centre: Wednesdays 2:30-5:30pm. Email: dedieula@math.mcmaster.ca. Elementary Matrices

More information

Module 18: Loop Optimizations Lecture 35: Amdahl s Law. The Lecture Contains: Amdahl s Law. Induction Variable Substitution.

Module 18: Loop Optimizations Lecture 35: Amdahl s Law. The Lecture Contains: Amdahl s Law. Induction Variable Substitution. The Lecture Contains: Amdahl s Law Induction Variable Substitution Index Recurrence Loop Unrolling Constant Propagation And Expression Evaluation Loop Vectorization Partial Loop Vectorization Nested Loops

More information

x = 12 x = 12 1x = 16

x = 12 x = 12 1x = 16 2.2 - The Inverse of a Matrix We've seen how to add matrices, multiply them by scalars, subtract them, and multiply one matrix by another. The question naturally arises: Can we divide one matrix by another?

More information

Linear Optimization and Extensions: Theory and Algorithms

Linear Optimization and Extensions: Theory and Algorithms AT&T Linear Optimization and Extensions: Theory and Algorithms Shu-Cherng Fang North Carolina State University Sarai Puthenpura AT&T Bell Labs Prentice Hall, Englewood Cliffs, New Jersey 07632 Contents

More information

IN TELECOM and real-time multimedia applications including

IN TELECOM and real-time multimedia applications including IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, VOL. 15, NO. 4, APRIL 2007 447 Computation of Storage Requirements for Multi-Dimensional Signal Processing Applications Florin Balasa,

More information

Some Advanced Topics in Linear Programming

Some Advanced Topics in Linear Programming Some Advanced Topics in Linear Programming Matthew J. Saltzman July 2, 995 Connections with Algebra and Geometry In this section, we will explore how some of the ideas in linear programming, duality theory,

More information

Mapping Multi-Dimensional Signals into Hierarchical Memory Organizations

Mapping Multi-Dimensional Signals into Hierarchical Memory Organizations Mapping Multi-Dimensional Signals into Hierarchical Memory Organizations Hongwei Zhu Ilie I. Luican Florin Balasa Dept. of Computer Science, University of Illinois at Chicago, {hzhu7,iluica2,fbalasa}@uic.edu

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information

Code Generation Methods for Tiling Transformations

Code Generation Methods for Tiling Transformations Code Generation Methods for Tiling Transformations GEORGIOS GOUMAS,MARIA ATHANASAKI AND NECTARIOS KOZIRIS National Technical University of Athens Dept. of Electrical and Computer Engineering Computing

More information

Module 18: Loop Optimizations Lecture 36: Cycle Shrinking. The Lecture Contains: Cycle Shrinking. Cycle Shrinking in Distance Varying Loops

Module 18: Loop Optimizations Lecture 36: Cycle Shrinking. The Lecture Contains: Cycle Shrinking. Cycle Shrinking in Distance Varying Loops The Lecture Contains: Cycle Shrinking Cycle Shrinking in Distance Varying Loops Loop Peeling Index Set Splitting Loop Fusion Loop Fission Loop Reversal Loop Skewing Iteration Space of The Loop Example

More information

Rubber bands. Chapter Rubber band representation

Rubber bands. Chapter Rubber band representation Chapter 1 Rubber bands In the previous chapter, we already used the idea of looking at the graph geometrically, by placing its nodes on the line and replacing the edges by rubber bands. Since, however,

More information

EULER S FORMULA AND THE FIVE COLOR THEOREM

EULER S FORMULA AND THE FIVE COLOR THEOREM EULER S FORMULA AND THE FIVE COLOR THEOREM MIN JAE SONG Abstract. In this paper, we will define the necessary concepts to formulate map coloring problems. Then, we will prove Euler s formula and apply

More information

Ranking Functions. Linear-Constraint Loops

Ranking Functions. Linear-Constraint Loops for Linear-Constraint Loops Amir Ben-Amram 1 for Loops Example 1 (GCD program): while (x > 1, y > 1) if x

More information

Contents of Lecture 11

Contents of Lecture 11 Contents of Lecture 11 Unimodular Transformations Inner Loop Parallelization SIMD Vectorization Jonas Skeppstedt (js@cs.lth.se) Lecture 11 2016 1 / 25 Unimodular Transformations A unimodular transformation

More information

Package lintools. July 30, 2018

Package lintools. July 30, 2018 Package lintools July 30, 2018 Maintainer Mark van der Loo License GPL-3 Title Manipulation of Linear Systems of (in)equalities LazyData no Type Package LazyLoad yes Variale

More information

Cluster algebras and infinite associahedra

Cluster algebras and infinite associahedra Cluster algebras and infinite associahedra Nathan Reading NC State University CombinaTexas 2008 Coxeter groups Associahedra and cluster algebras Sortable elements/cambrian fans Infinite type Much of the

More information

Optimization of Design. Lecturer:Dung-An Wang Lecture 8

Optimization of Design. Lecturer:Dung-An Wang Lecture 8 Optimization of Design Lecturer:Dung-An Wang Lecture 8 Lecture outline Reading: Ch8 of text Today s lecture 2 8.1 LINEAR FUNCTIONS Cost Function Constraints 3 8.2 The standard LP problem Only equality

More information

Linear Programming. Course review MS-E2140. v. 1.1

Linear Programming. Course review MS-E2140. v. 1.1 Linear Programming MS-E2140 Course review v. 1.1 Course structure Modeling techniques Linear programming theory and the Simplex method Duality theory Dual Simplex algorithm and sensitivity analysis Integer

More information

A constructive solution to the juggling problem in systolic array synthesis

A constructive solution to the juggling problem in systolic array synthesis A constructive solution to the juggling problem in systolic array synthesis Alain Darte Robert Schreiber B. Ramakrishna Rau Frédéric Vivien LIP, ENS-Lyon, Lyon, France Hewlett-Packard Company, Palo Alto,

More information

R n a T i x = b i} is a Hyperplane.

R n a T i x = b i} is a Hyperplane. Geometry of LPs Consider the following LP : min {c T x a T i x b i The feasible region is i =1,...,m}. X := {x R n a T i x b i i =1,...,m} = m i=1 {x Rn a T i x b i} }{{} X i The set X i is a Half-space.

More information

MATH 890 HOMEWORK 2 DAVID MEREDITH

MATH 890 HOMEWORK 2 DAVID MEREDITH MATH 890 HOMEWORK 2 DAVID MEREDITH (1) Suppose P and Q are polyhedra. Then P Q is a polyhedron. Moreover if P and Q are polytopes then P Q is a polytope. The facets of P Q are either F Q where F is a facet

More information

On the Dimension of the Bivariate Spline Space S 1 3( )

On the Dimension of the Bivariate Spline Space S 1 3( ) On the Dimension of the Bivariate Spline Space S 1 3( ) Gašper Jaklič Institute of Mathematics, Physics and Mechanics University of Ljubljana Jadranska 19, 1000 Ljubljana, Slovenia Gasper.Jaklic@fmf.uni-lj.si

More information

LECTURES 3 and 4: Flows and Matchings

LECTURES 3 and 4: Flows and Matchings LECTURES 3 and 4: Flows and Matchings 1 Max Flow MAX FLOW (SP). Instance: Directed graph N = (V,A), two nodes s,t V, and capacities on the arcs c : A R +. A flow is a set of numbers on the arcs such that

More information

Three applications of Euler s formula. Chapter 10

Three applications of Euler s formula. Chapter 10 Three applications of Euler s formula Chapter 10 A graph is planar if it can be drawn in the plane R without crossing edges (or, equivalently, on the -dimensional sphere S ). We talk of a plane graph if

More information

LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION. 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach

LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION. 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach Basic approaches I. Primal Approach - Feasible Direction

More information