tiling for dynamic scheduling
play

Tiling for Dynamic Scheduling Ravi Teja Mullapudi Uday Bondhugula - PowerPoint PPT Presentation

Tiling for Dynamic Scheduling Ravi Teja Mullapudi Uday Bondhugula CSA, Indian Institue of Science January 20, 2014 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 1 / 25 Table of Contents Tiling 1 Introduction Validity


  1. Tiling for Dynamic Scheduling Ravi Teja Mullapudi Uday Bondhugula CSA, Indian Institue of Science January 20, 2014 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 1 / 25

  2. Table of Contents Tiling 1 Introduction Validity Limitations 2 Where do current approaches fail? Directions 3 Localizing Dependences Iterative Tiling Approximate Cycle Check Applications 4 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 2 / 25

  3. Table of Contents Tiling 1 Introduction Validity Limitations 2 Where do current approaches fail? Directions 3 Localizing Dependences Iterative Tiling Approximate Cycle Check Applications 4 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 3 / 25

  4. Tiling Definition (Computation Graph) A directed acyclic graph in which the nodes represent operations and edges denote dependences between operations Definition (Tiling) Partitioning a computation graph into atomic units of execution Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 4 / 25

  5. Iteration spaces, Dependences and Hyperplanes i for (i = 0; i < N; i++){ for ( j = 0; j < N; j++) { A[j] = A[j] + B[i]; s 1 if (i == j) B[i+1] = A[j]; s 2 } } j Iteration spaces D s = � � � � � � i s ∈ Z n , A � i s + b ≥ 0 i s � Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 5 / 25

  6. Iteration spaces, Dependences and Hyperplanes i for (i = 0; i < N; i++){ for ( j = 0; j < N; j++) { A[j] = A[j] + B[i]; s 1 if (i == j) B[i+1] = A[j]; s 2 } } j Dependences � � � � � i s ,� � � i s ∈ D s ,� i t ∈ D t , � i s = h e ( � i t � i t ) , e : s → t P e = � Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 5 / 25

  7. Iteration spaces, Dependences and Hyperplanes i φ 1 for (i = 0; i < N; i++){ for ( j = 0; j < N; j++) { A[j] = A[j] + B[i]; s 1 if (i == j) B[i+1] = A[j]; s 2 } } j φ 2 Hyperplanes φ s ( � i s ) = � h · � i s + h 0 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 5 / 25

  8. Iteration spaces, Dependences and Hyperplanes i φ 1 for (i = 0; i < N; i++){ for ( j = 0; j < N; j++) { A[j] = A[j] + B[i]; s 1 if (i == j) B[i+1] = A[j]; s 2 } } j φ 2 Hyperplanes φ s ( � i s ) = � h · � i s + h 0 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 5 / 25

  9. Validity Conditions i i φ 1 φ 1 j j φ 2 φ 2 Non-Negative Dependence Components φ t ( � i t ) − φ s ( � i s ) ≥ 0 , � � i s ,� i t � ∈ P e , e : s → t ( HD ≥ 0) Irigoin and Triolet, Lim and Lam, Griebl, Pluto Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 6 / 25

  10. Validity Conditions i i φ 1 φ 1 j j φ 2 φ 2 Lexicographically Non-Negative Tile Dependences ⌊ HD ⌋ � � 0 Xue Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 6 / 25

  11. Table of Contents Tiling 1 Introduction Validity Limitations 2 Where do current approaches fail? Directions 3 Localizing Dependences Iterative Tiling Approximate Cycle Check Applications 4 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 7 / 25

  12. Conservative Validity Conditions i φ 1 for (i = 0; i < N; i++){ for ( j = 0; j < N; j++) { A[j] = A[j] + B[i]; s 1 if (i == j) B[i+1] = A[j]; s 2 } } j φ 2 Negative dependence components along φ 2 but tiling is valid Inter-tile dependences lexicographically negative Tile sizes effect validity Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 8 / 25

  13. Conservative Validity Conditions i φ 1 (0 , 2) (1 , 2) (2 , 2) (0 , 1) (1 , 1) (2 , 1) (0 , 0) (1 , 0) (2 , 0) j φ 2 Negative dependence components along φ 2 but tiling is valid Inter-tile dependences lexicographically negative Tile sizes effect validity Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 8 / 25

  14. Conservative Validity Conditions i φ 1 (0 , 2) (1 , 2) (2 , 2) (0 , 1) (1 , 1) (2 , 1) (0 , 0) (1 , 0) (2 , 0) j φ 2 Negative dependence components along φ 2 but tiling is valid Inter-tile dependences lexicographically negative Tile sizes effect validity Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 8 / 25

  15. Conservative Validity Conditions i i φ 1 φ 1 j j φ 2 φ 2 Negative dependence components along φ 2 but tiling is valid Inter-tile dependences lexicographically negative Tile sizes effect validity Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 8 / 25

  16. Uniformly Tiling Iteration Spaces i for (i = 0; i < N; i++){ φ 1 for ( j = 0; j < N; j++) { if (j > i) A[j] = A[j] + A[i]; s 1 if (j < i) A[j] = A[j] + A[i]; s 2 } } j φ 2 Tile dependence graph has cycles Splitting breaks cycles Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 9 / 25

  17. Uniformly Tiling Iteration Spaces i for (i = 0; i < N; i++){ φ 1 for ( j = 0; j < N; j++) { if (j > i) A[j] = A[j] + A[i]; s 1 if (j < i) A[j] = A[j] + A[i]; s 2 } } j φ 2 Tile dependence graph has cycles Splitting breaks cycles Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 9 / 25

  18. Uniformly Tiling Iteration Spaces i (0 , 2) (1 , 2) (2 , 2) (2 , 2) φ 1 (1 , 1) (0 , 1) (1 , 1) (2 , 1) (0 , 0) (0 , 0) (1 , 0) (2 , 0) j φ 2 Tile dependence graph has cycles Splitting breaks cycles Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 9 / 25

  19. Dynamic Scheduling (0 , 2) (1 , 2) (2 , 2) (2 , 2) (0 , 2) (1 , 2) (2 , 2) (1 , 1) (0 , 1) (1 , 1) (2 , 1) (0 , 1) (1 , 1) (2 , 1) (0 , 0) (1 , 0) (2 , 0) (0 , 0) (0 , 0) (1 , 0) (2 , 0) Not easy to come up with a static schedule for the tiles Dynamic task scheduler Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 10 / 25

  20. Table of Contents Tiling 1 Introduction Validity Limitations 2 Where do current approaches fail? Directions 3 Localizing Dependences Iterative Tiling Approximate Cycle Check Applications 4 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 11 / 25

  21. General Validity Condition Definition (Valid Tiling) A set of hyperplanes φ 1 , φ 2 , . . . , φ k with tile size τ i for φ i , is a valid tiling of an iteration space if the dependence graph of k -dimensional tiles formed by the hyperplanes with their respective tile sizes is cycle-free. Transitive closure of dependence relations Precise computation might be infeasible Expensive operation even for an approximation Conservative cycle detection Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 12 / 25

  22. Localizing Dependences Theorem { φ 1 , . . . , φ k } with tile size τ i for φ i is a valid tiling of an iteration space, if { φ 1 , . . . , φ k − 1 } is a valid tiling and φ k is a valid one-dimensional tiling of each k − 1 dimensional tile formed by { φ 1 , . . . , φ k − 1 } . φ 1 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 13 / 25

  23. Localizing Dependences Theorem { φ 1 , . . . , φ k } with tile size τ i for φ i is a valid tiling of an iteration space, if { φ 1 , . . . , φ k − 1 } is a valid tiling and φ k is a valid one-dimensional tiling of each k − 1 dimensional tile formed by { φ 1 , . . . , φ k − 1 } . φ 1 φ 2 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 13 / 25

  24. Localizing Dependences Theorem { φ 1 , . . . , φ k } with tile size τ i for φ i is a valid tiling of an iteration space, if { φ 1 , . . . , φ k − 1 } is a valid tiling and φ k is a valid one-dimensional tiling of each k − 1 dimensional tile formed by { φ 1 , . . . , φ k − 1 } . φ 1 φ 2 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 13 / 25

  25. Localizing Dependences Theorem { φ 1 , . . . , φ k } with tile size τ i for φ i is a valid tiling of an iteration space, if { φ 1 , . . . , φ k − 1 } is a valid tiling and φ k is a valid one-dimensional tiling of each k − 1 dimensional tile formed by { φ 1 , . . . , φ k − 1 } . φ 1 φ 2 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 13 / 25

  26. Localizing Dependences Theorem { φ 1 , . . . , φ k } with tile size τ i for φ i is a valid tiling of an iteration space, if { φ 1 , . . . , φ k − 1 } is a valid tiling and φ k is a valid one-dimensional tiling of each k − 1 dimensional tile formed by { φ 1 , . . . , φ k − 1 } . φ 1 Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 13 / 25

  27. Localizing Dependences Dependences in the transformed space � s , � t ,� i t �� | � � i s ,� �� T 1 s , . . . , T k i s � , � T 1 t , . . . , T k i t � ∈ P e , e : s → t , 1 ≤ l ≤ k , τ l ∗ T l s ≤ φ l s ( � i s ) ≤ τ l ∗ ( T l s + 1) − 1 , � t ( � τ l ∗ T l t ≤ φ l i t ) ≤ τ i ∗ ( T l t + 1) − 1 Inter-Tile Dependences P e denotes the inter-tile dependence polyhedron between k -dimensional tiles formed by � φ 1 , . . . , φ k � due to the depedence edge e . Ravi Teja M (IISc) Tiling for Dynamic Scheduling January 20, 2014 14 / 25

Recommend


More recommend