January 23, 2018 1 / 29
Extending Pluto-Style Polyhedral Scheduling with Consecutivity
Sven Verdoolaege1 Alexandre Isoard2
1KU Leuven and Polly Labs 2Xilinx
Extending Pluto-Style Polyhedral Scheduling with Consecutivity Sven - - PowerPoint PPT Presentation
January 23, 2018 1 / 29 Extending Pluto-Style Polyhedral Scheduling with Consecutivity Sven Verdoolaege 1 Alexandre Isoard 2 1 KU Leuven and Polly Labs 2 Xilinx January 23, 2018 January 23, 2018 2 / 29 Outline Introduction 1 Consecutivity
January 23, 2018 1 / 29
1KU Leuven and Polly Labs 2Xilinx
January 23, 2018 2 / 29
Introduction January 23, 2018 3 / 29
Introduction Consecutivity Concept January 23, 2018 4 / 29
Introduction Consecutivity Concept January 23, 2018 4 / 29
Introduction Consecutivity Concept January 23, 2018 4 / 29
Introduction Consecutivity Concept January 23, 2018 4 / 29
Introduction Consecutivity Concept January 23, 2018 5 / 29
Introduction Consecutivity Concept January 23, 2018 5 / 29
Introduction Consecutivity Concept January 23, 2018 5 / 29
Introduction Consecutivity Concept January 23, 2018 5 / 29
Introduction Consecutivity Concept January 23, 2018 6 / 29
Introduction Consecutivity Concept January 23, 2018 6 / 29
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 7 / 29
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 7 / 29
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 7 / 29
◮ Pluto-style schedulers, e.g., Pluto, isl
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 7 / 29
◮ Pluto-style schedulers, e.g., Pluto, isl
◮ one-shot schedulers (Vasilache 2007)
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 7 / 29
◮ Pluto-style schedulers, e.g., Pluto, isl
◮ one-shot schedulers (Vasilache 2007)
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 8 / 29
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 8 / 29
Introduction Pluto-Style Polyhedral Scheduling January 23, 2018 8 / 29
Introduction Consecutivity Criterion January 23, 2018 9 / 29
Introduction Consecutivity Criterion January 23, 2018 9 / 29
Introduction Consecutivity Criterion January 23, 2018 9 / 29
Introduction Consecutivity Criterion January 23, 2018 9 / 29
Introduction Consecutivity Criterion January 23, 2018 10 / 29
Introduction Consecutivity Criterion January 23, 2018 10 / 29
Introduction Consecutivity Criterion January 23, 2018 11 / 29
Introduction Consecutivity Criterion January 23, 2018 11 / 29
Introduction Consecutivity Criterion January 23, 2018 11 / 29
Introduction Consecutivity Criterion January 23, 2018 11 / 29
Introduction Related Work January 23, 2018 12 / 29
◮ define temporal (ker F) and spatial (ker G) reuse directions ◮ partition original loop iterators
◮ aim: spatial locality ◮ criterion more strict than required (ensures consecutivity) ◮ incrementally fix elements of T−1
◮ pick (second to) last column of T−1 from ker G
Introduction Related Work January 23, 2018 13 / 29
◮ pick proto-schedule T orthogonal to element from ker G (or ker F) ◮ construct valid schedule C T ◮ imposing constraints on linear combinations
◮ aim: spatial locality (ker T1 ⊆ ker G) ◮ one-shot scheduler called multiple times ◮ soft constraints encoded in ILP
◮ aim: consecutivity (stride-1 or stride-0) ◮ partition original loop iterators ◮ soft constraints encoded in ILP
◮ spatial locality through spatial proximity constraints ◮ soft constraints encoded in ILP
Introduction Related Work January 23, 2018 14 / 29
◮ loop iterators in outer index expressions appear in outer schedule rows ◮ loop iterators in innermost index expression
Introduction Related Work January 23, 2018 14 / 29
◮ loop iterators in outer index expressions appear in outer schedule rows ◮ loop iterators in innermost index expression
◮ consecutivity requires innermost index expression to be equal to
◮ how to handle iterators that appear in both?
Introduction Related Work January 23, 2018 14 / 29
◮ loop iterators in outer index expressions appear in outer schedule rows ◮ loop iterators in innermost index expression
◮ consecutivity requires innermost index expression to be equal to
◮ how to handle iterators that appear in both?
Introduction Related Work January 23, 2018 14 / 29
◮ loop iterators in outer index expressions appear in outer schedule rows ◮ loop iterators in innermost index expression
◮ consecutivity requires innermost index expression to be equal to
◮ how to handle iterators that appear in both?
Introduction Related Work January 23, 2018 15 / 29
◮ does not perform reversal, skewing ◮ does not differentiate between statements ◮ does not affect shape of schedule (e.g., distribution)
Introduction Related Work January 23, 2018 15 / 29
◮ does not perform reversal, skewing ◮ does not differentiate between statements ◮ does not affect shape of schedule (e.g., distribution)
◮ without consecutivity:
◮ with consecutivity:
Intra-Statement Consecutivity January 23, 2018 16 / 29
Intra-Statement Consecutivity Consecutivity Criterion January 23, 2018 17 / 29
Intra-Statement Consecutivity Consecutivity Criterion January 23, 2018 17 / 29
Intra-Statement Consecutivity Consecutivity Criterion January 23, 2018 17 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 18 / 29
◮ H linearly independent of G
◮ G linear combination of outer schedule rows: G = A T1 ◮ H equal to innermost schedule row : H = T2 + B T1
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 18 / 29
◮ H linearly independent of G
◮ G linear combination of outer schedule rows: G = A T1 ◮ H equal to innermost schedule row : H = T2 + B T1
◮ maximize number of satisfied consecutivity constraints ◮ consider constraints in order specified by user
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 18 / 29
◮ H linearly independent of G
◮ G linear combination of outer schedule rows: G = A T1 ◮ H equal to innermost schedule row : H = T2 + B T1
◮ maximize number of satisfied consecutivity constraints ◮ consider constraints in order specified by user
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 18 / 29
◮ H linearly independent of G ◮ rows of H linearly independent
◮ G linear combination of outer schedule rows: G = A T1 ◮ H equal to innermost schedule rows: H = T2 + B T1
◮ maximize number of satisfied consecutivity constraints ◮ consider constraints in order specified by user
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 19 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 19 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 19 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 19 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 19 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 20 / 29
Intra-Statement Consecutivity Specifying Schedule Constraints January 23, 2018 20 / 29
◮ multiple levels of consecutivity ◮ multiple levels of temporal locality (optional)
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 21 / 29
S,0 = 0
S 0
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 22 / 29
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 22 / 29
1
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 22 / 29
1
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 22 / 29
1
Intra-Statement Consecutivity Transformation to Constraints on Schedule Coefficients January 23, 2018 22 / 29
1
Intra-Statement Consecutivity Solving Constraints on Schedule Coefficients (isl) January 23, 2018 23 / 29
Intra-Statement Consecutivity Solving Constraints on Schedule Coefficients (isl) January 23, 2018 23 / 29
◮ extra rows H ⇒ fewer rows in U′′ ⇒ fewer backtracking cases ◮ no extra ILP variables, but possibly more backtracking
Intra-Statement Consecutivity Solving Constraints on Schedule Coefficients (isl) January 23, 2018 23 / 29
◮ extra rows H ⇒ fewer rows in U′′ ⇒ fewer backtracking cases ◮ no extra ILP variables, but possibly more backtracking
◮ optional ◮ fixed part that applies in each backtracking case ◮ disjunctive (independent or dependent rows) ◮ conditional (multiple consecutivity constraints)
Inter-Statement Consecutivity January 23, 2018 24 / 29
Inter-Statement Consecutivity January 23, 2018 25 / 29
Local Rescheduling January 23, 2018 26 / 29
Local Rescheduling January 23, 2018 27 / 29
1
2
3
Local Rescheduling January 23, 2018 27 / 29
1
2
3
Conclusions and Future Work January 23, 2018 28 / 29
Conclusions and Future Work January 23, 2018 29 / 29
January 23, 2018 1 / 4
January 23, 2018 2 / 4
January 23, 2018 3 / 4
January 23, 2018 4 / 4