schedule trees
play

Schedule Trees Sven Verdoolaege 1 Serge Guelton 2 Tobias Grosser 3 - PowerPoint PPT Presentation

January 20, 2014 1 / 21 Schedule Trees Sven Verdoolaege 1 Serge Guelton 2 Tobias Grosser 3 Albert Cohen 3 1 INRIA, Ecole Normale Sup erieure and KU Leuven 2 Ecole Normale Sup erieure and T el ecom Bretagne 3 INRIA and Ecole


  1. January 20, 2014 1 / 21 Schedule Trees Sven Verdoolaege 1 Serge Guelton 2 Tobias Grosser 3 Albert Cohen 3 1 INRIA, ´ Ecole Normale Sup´ erieure and KU Leuven 2 ´ Ecole Normale Sup´ erieure and T´ el´ ecom Bretagne 3 INRIA and ´ Ecole Normale Sup´ erieure January 20, 2014

  2. January 20, 2014 2 / 21 Outline Introduction 1 Example Single Statement Multiple Statements Schedule Trees Advantages 2 Useful in several contexts More natural More convenient More expressive Extensible Conclusion 3

  3. Introduction January 20, 2014 3 / 21 Outline Introduction 1 Example Single Statement Multiple Statements Schedule Trees Advantages 2 Useful in several contexts More natural More convenient More expressive Extensible Conclusion 3

  4. Introduction Example January 20, 2014 4 / 21 Introductory Example for (i = 0; i <= N; ++i) S: a[i] = g(i); for (i = 0; i <= N; ++i) T: b[i] = f(a[N-i]);

  5. Introduction Example January 20, 2014 4 / 21 Introductory Example for (i = 0; i <= N; ++i) S: a[i] = g(i); for (i = 0; i <= N; ++i) T: b[i] = f(a[N-i]); Iteration domain { S [ i ] : 0 ≤ i ≤ N ; T [ i ] : 0 ≤ i ≤ N } Dependences { S [ i ] → T [ N − i ] : 0 ≤ i ≤ N } Execution Order ◮ Original Order S [ 0 ] , S [ 1 ] , S [ 2 ] , . . . , S [ N − 1 ] , S [ N ] , T [ 0 ] , T [ 1 ] , T [ 2 ] , . . . , T [ N − 1 ] , T [ N ]

  6. Introduction Example January 20, 2014 4 / 21 Introductory Example for (i = 0; i <= N; ++i) S: a[i] = g(i); for (i = 0; i <= N; ++i) T: b[i] = f(a[N-i]); Iteration domain { S [ i ] : 0 ≤ i ≤ N ; T [ i ] : 0 ≤ i ≤ N } Dependences { S [ i ] → T [ N − i ] : 0 ≤ i ≤ N } Execution Order ◮ Original Order S [ 0 ] , S [ 1 ] , S [ 2 ] , . . . , S [ N − 1 ] , S [ N ] , T [ 0 ] , T [ 1 ] , T [ 2 ] , . . . , T [ N − 1 ] , T [ N ] ◮ Alternative Order S [ 0 ] , T [ N ] , S [ 1 ] , T [ N − 1 ] , S [ 2 ] , T [ N − 2 ] , . . . , S [ N − 1 ] , T [ 1 ] , S [ N ] , T [ 0 ]

  7. Introduction Example January 20, 2014 4 / 21 Introductory Example for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { S: a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); T: b[i] = f(a[N-i]); } Iteration domain { S [ i ] : 0 ≤ i ≤ N ; T [ i ] : 0 ≤ i ≤ N } Dependences { S [ i ] → T [ N − i ] : 0 ≤ i ≤ N } Execution Order ◮ Original Order S [ 0 ] , S [ 1 ] , S [ 2 ] , . . . , S [ N − 1 ] , S [ N ] , T [ 0 ] , T [ 1 ] , T [ 2 ] , . . . , T [ N − 1 ] , T [ N ] ◮ Alternative Order S [ 0 ] , T [ N ] , S [ 1 ] , T [ N − 1 ] , S [ 2 ] , T [ N − 2 ] , . . . , S [ N − 1 ] , T [ 1 ] , S [ N ] , T [ 0 ]

  8. Introduction Single Statement January 20, 2014 5 / 21 Expressing Transformations (Single Statement) for (i = 0; i <= N; ++i) ⇒ for (i = 0; i <= N; ++i) b[i] = f(a[N-i]); b[N-i] = f(a[i]);

  9. Introduction Single Statement January 20, 2014 5 / 21 Expressing Transformations (Single Statement) for (i = 0; i <= N; ++i) ⇒ for (i = 0; i <= N; ++i) b[i] = f(a[N-i]); b[N-i] = f(a[i]); Two approaches Modify Iteration Domain 1 T [ i ] → T ′ [ N − i ] ◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly

  10. Introduction Single Statement January 20, 2014 5 / 21 Expressing Transformations (Single Statement) for (i = 0; i <= N; ++i) ⇒ for (i = 0; i <= N; ++i) b[i] = f(a[N-i]); b[N-i] = f(a[i]); Two approaches Modify Iteration Domain 1 T [ i ] → T ′ [ N − i ] ◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly Explicit Schedule 2 T [ i ] → [ N − i ] ◮ iteration domains have no implicit execution order ◮ execution order is determined by schedule space (lexicographic order) ◮ AST generator takes iteration domain and schedule as input ◮ schedule is typically a piecewise quasi-affine function

  11. Introduction Single Statement January 20, 2014 5 / 21 Expressing Transformations (Single Statement) for (i = 0; i <= N; ++i) ⇒ for (i = 0; i <= N; ++i) b[i] = f(a[N-i]); b[N-i] = f(a[i]); Two approaches Modify Iteration Domain 1 T [ i ] → T ′ [ N − i ] ◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly Explicit Schedule 2 T [ i ] → [ N − i ] ◮ iteration domains have no implicit execution order ◮ execution order is determined by schedule space (lexicographic order) ◮ AST generator takes iteration domain and schedule as input ◮ schedule is typically a piecewise quasi-affine function

  12. Introduction Single Statement January 20, 2014 5 / 21 Expressing Transformations (Single Statement) for (i = 0; i <= N; ++i) ⇒ for (i = 0; i <= N; ++i) b[i] = f(a[N-i]); b[N-i] = f(a[i]); Two approaches Modify Iteration Domain 1 T [ i ] → T ′ [ N − i ] ◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly Explicit Schedule 2 T [ i ] → [ N − i ] ◮ iteration domains have no implicit execution order ◮ execution order is determined by schedule space (lexicographic order) ◮ AST generator takes iteration domain and schedule as input ◮ schedule is typically a piecewise quasi-affine function

  13. Introduction Multiple Statements January 20, 2014 6 / 21 Representing Schedules for Multiple Statements for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); b[i] = f(a[N-i]); } S [ i ] → [ i ]; T [ i ] → [ N − i ] first S [ i ] then T [ i ] S [ i ] → [ i ] T [ i ] → [ i ] first S [ i ] then T [ i ]

  14. Introduction Multiple Statements January 20, 2014 6 / 21 Representing Schedules for Multiple Statements for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); b[i] = f(a[N-i]); } S [ i ] → [ i ]; T [ i ] → [ N − i ] first S [ i ] then T [ i ] S [ i ] → [ i ] T [ i ] → [ i ] first S [ i ] then T [ i ] S : { [ i ] → [ 0 , i ] } S : { [ i ] → [ i , 0 ] } Kelly T : { [ i ] → [ 1 , i ] } T : { [ i ] → [ N − i , 1 ] } ⇒ encode statement ordering in affine function

  15. Introduction Multiple Statements January 20, 2014 6 / 21 Representing Schedules for Multiple Statements for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); b[i] = f(a[N-i]); } S [ i ] → [ i ]; T [ i ] → [ N − i ] first S [ i ] then T [ i ] S [ i ] → [ i ] T [ i ] → [ i ] first S [ i ] then T [ i ] S : { [ i ] → [ 0 , i ] } S : { [ i ] → [ i , 0 ] } Kelly T : { [ i ] → [ 1 , i ] } T : { [ i ] → [ N − i , 1 ] } union { S [ i ] → [ 0 , i ]; T [ i ] → [ 1 , i ] } { S [ i ] → [ i , 0 ]; T [ i ] → [ N − i , 1 ] } map ⇒ encode statement ordering in affine function

  16. Introduction Multiple Statements January 20, 2014 6 / 21 Representing Schedules for Multiple Statements for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); b[i] = f(a[N-i]); } sequence S [ i ] → [ i ]; T [ i ] → [ N − i ] S [ i ] T [ i ] sequence schedule tree S [ i ] → [ i ] T [ i ] → [ i ] S [ i ] T [ i ] S : { [ i ] → [ 0 , i ] } S : { [ i ] → [ i , 0 ] } Kelly T : { [ i ] → [ 1 , i ] } T : { [ i ] → [ N − i , 1 ] } union { S [ i ] → [ 0 , i ]; T [ i ] → [ 1 , i ] } { S [ i ] → [ i , 0 ]; T [ i ] → [ N − i , 1 ] } map

  17. Introduction Multiple Statements January 20, 2014 6 / 21 Representing Schedules for Multiple Statements for (i = 0; i <= N; ++i) for (i = 0; i <= N; ++i) { a[i] = g(i); a[i] = g(i); for (i = 0; i <= N; ++i) b[N-i] = f(a[i]); b[i] = f(a[N-i]); } sequence S [ i ] → [ i ]; T [ i ] → [ N − i ] S [ i ] T [ i ] sequence schedule tree S [ i ] → [ i ] T [ i ] → [ i ] S [ i ] T [ i ] S : { [ i ] → [ 0 , i ] } S : { [ i ] → [ i , 0 ] } Kelly T : { [ i ] → [ 1 , i ] } T : { [ i ] → [ N − i , 1 ] } union { S [ i ] → [ 0 , i ]; T [ i ] → [ 1 , i ] } { S [ i ] → [ i , 0 ]; T [ i ] → [ N − i , 1 ] } map “2 d + 1”: special case of Kelly’s abstraction Other representations: band forest: precursor to schedule trees

  18. Introduction Schedule Trees January 20, 2014 7 / 21 Schedule Trees sequence { S [ i ] } { T [ i ] } { S [ i ] → [ i ] } { T [ i ] → [ i ] } Core node types ◮ Band: multi-dimensional piecewise quasi-affine partial schedule ◮ Filter: selects statement instances that are executed by descendants ◮ Sequence: children executed in given order ◮ Set: children executed in arbitrary order

  19. Introduction Schedule Trees January 20, 2014 7 / 21 Schedule Trees sequence { S [ i ] } { T [ i ] } { S [ i ] → [ i ] } { T [ i ] → [ i ] } Core node types ◮ Band: multi-dimensional piecewise quasi-affine partial schedule ◮ Filter: selects statement instances that are executed by descendants ◮ Sequence: children executed in given order ◮ Set: children executed in arbitrary order

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend