January 20, 2014 1 / 21
Schedule Trees
Sven Verdoolaege1 Serge Guelton2 Tobias Grosser3 Albert Cohen3
1INRIA, ´
Ecole Normale Sup´ erieure and KU Leuven
2 ´
Ecole Normale Sup´ erieure and T´ el´ ecom Bretagne
3INRIA and ´
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
January 20, 2014 1 / 21
1INRIA, ´
2 ´
3INRIA and ´
January 20, 2014 2 / 21
Introduction January 20, 2014 3 / 21
Introduction Example January 20, 2014 4 / 21
Introduction Example January 20, 2014 4 / 21
◮ Original Order
Introduction Example January 20, 2014 4 / 21
◮ Original Order
◮ Alternative Order
Introduction Example January 20, 2014 4 / 21
◮ Original Order
◮ Alternative Order
Introduction Single Statement January 20, 2014 5 / 21
Introduction Single Statement January 20, 2014 5 / 21
1
◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly
Introduction Single Statement January 20, 2014 5 / 21
1
◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly 2
◮ 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
Introduction Single Statement January 20, 2014 5 / 21
1
◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly 2
◮ 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
Introduction Single Statement January 20, 2014 5 / 21
1
◮ iteration domains have implicit execution order (lexicographic order) ◮ AST generator takes modified iteration domain as input ◮ access relations and dependence relations are adjusted accordingly 2
◮ 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
Introduction Multiple Statements January 20, 2014 6 / 21
Introduction Multiple Statements January 20, 2014 6 / 21
Introduction Multiple Statements January 20, 2014 6 / 21
Introduction Multiple Statements January 20, 2014 6 / 21
Introduction Multiple Statements January 20, 2014 6 / 21
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
◮ Domain: set of statement instances to be scheduled ◮ Context: external constraints on symbolic constants
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
◮ Domain: set of statement instances to be scheduled ◮ Context: external constraints on symbolic constants
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
◮ Domain: set of statement instances to be scheduled ◮ Context: external constraints on symbolic constants
Introduction Schedule Trees January 20, 2014 7 / 21
◮ 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
◮ Domain: set of statement instances to be scheduled ◮ Context: external constraints on symbolic constants
◮ Mark: attach additional information to subtrees ◮ Leaf: for easy navigation
Introduction Schedule Trees January 20, 2014 8 / 21
◮ schedule spread over statements ◮ relaxed lexicographic order
◮ single object ◮ strict lexicographic order ◮ schedule transformations can be composed
◮ single object ◮ relaxed lexicographic order
Advantages January 20, 2014 9 / 21
Advantages Useful in several contexts January 20, 2014 10 / 21
◮ Input to dependence analysis (in isl) ◮ Basis for manual/incremental transformations
◮ Construction based on dependences ◮ Schedule modifications
◮ Generate AST from schedule
Advantages Useful in several contexts January 20, 2014 10 / 21
◮ Input to dependence analysis (in isl) ◮ Basis for manual/incremental transformations
◮ Construction based on dependences ◮ Schedule modifications
◮ Generate AST from schedule
Advantages Useful in several contexts January 20, 2014 11 / 21
Advantages Useful in several contexts January 20, 2014 11 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More natural January 20, 2014 12 / 21
Advantages More convenient January 20, 2014 13 / 21
1
2
◮ Given a band D(i) → f(i), insert a band D(i) → f(i)/S ◮ First iterate over blocks of size S and then iterate within each block
Advantages More convenient January 20, 2014 13 / 21
1
2
◮ Given a band D(i) → f(i), insert a band D(i) → f(i)/S ◮ First iterate over blocks of size S and then iterate within each block
◮ bands of different dimensionality ◮ different tile sizes S per band
Advantages More convenient January 20, 2014 13 / 21
1
2
◮ Given a band D(i) → f(i), insert a band D(i) → f(i)/S ◮ First iterate over blocks of size S and then iterate within each block
◮ bands of different dimensionality ◮ different tile sizes S per band
Advantages More convenient January 20, 2014 13 / 21
1
2
◮ Given a band D(i) → f(i), insert a band D(i) → f(i)/S ◮ First iterate over blocks of size S and then iterate within each block
◮ bands of different dimensionality ◮ different tile sizes S per band
Advantages More convenient January 20, 2014 13 / 21
1
2
◮ Given a band D(i) → f(i), insert a band D(i) → f(i)/S ◮ First iterate over blocks of size S and then iterate within each block
◮ bands of different dimensionality ◮ different tile sizes S per band
Advantages More convenient January 20, 2014 14 / 21
Advantages More convenient January 20, 2014 14 / 21
Advantages More convenient January 20, 2014 14 / 21
Advantages More expressive January 20, 2014 15 / 21
Advantages More expressive January 20, 2014 16 / 21
◮ Outer part mapped to host code ◮ Subtrees mapped to device code
Advantages More expressive January 20, 2014 16 / 21
◮ Outer part mapped to host code ◮ Subtrees mapped to device code
Advantages More expressive January 20, 2014 17 / 21
Advantages More expressive January 20, 2014 17 / 21
Advantages More expressive January 20, 2014 17 / 21
Advantages More expressive January 20, 2014 17 / 21
Advantages Extensible January 20, 2014 18 / 21
Advantages Extensible January 20, 2014 19 / 21
Advantages Extensible January 20, 2014 19 / 21
Advantages Extensible January 20, 2014 19 / 21
Conclusion January 20, 2014 20 / 21
Conclusion January 20, 2014 21 / 21
Conclusion January 20, 2014 21 / 21
◮ parametric tiling ◮ clustering ◮ . . .