Presentation is loading. Please wait.

Presentation is loading. Please wait.

Carnegie Mellon 1 Optimal Scheduling “in a lifetime” for the SPIRAL compiler Frédéric de Mesmay Theodoros Strigkos based on Y. Voronenko’s idea.

Similar presentations


Presentation on theme: "Carnegie Mellon 1 Optimal Scheduling “in a lifetime” for the SPIRAL compiler Frédéric de Mesmay Theodoros Strigkos based on Y. Voronenko’s idea."— Presentation transcript:

1 Carnegie Mellon 1 Optimal Scheduling “in a lifetime” for the SPIRAL compiler Frédéric de Mesmay Theodoros Strigkos based on Y. Voronenko’s idea

2 Carnegie Mellon 2 Scientific Code Generation Approaches Produces Blocked, Parallelized, SIMDized, Scheduled code Backend : C, asm, verilog

3 Carnegie Mellon 3 The SPIRAL compiler The IR is simple  SSA form  no function calls  no pointers  type is uniform  no control flow (this is dealt by others)  Huge simple DAG SPIRAL compiles libraries  Plenty of time for compilation…

4 Carnegie Mellon 4 Scheduling & Register Allocation Traditionally done in two different passes  The first pass is imposing constraints on the second  Allocate registers first  introduce anti- and output dependencies  used when targeting OoO architectures –few ISA registers, hardware scheduler  Schedule first  may run out of registers  used when targeting In-order processors –plenty of registers, limited hardware scheduling

5 Carnegie Mellon 5 Scheduling & Register Allocation Optimality is achieved with Integer Linear Programming (ILP)  Schedule code and allocate registers together  Model processor with constraints  Solve the equations  Optimal Scheduling = NP complete Optimal Register Allocation = NP complete  Simultaneous Allocation and Scheduling = Problematic

6 Carnegie Mellon 6 Node Packing Graph Adder #1 Adder #2 Cycle 1Cycle 2Cycle 3 a a a a a <- x + 3 b <- x + 5 c <- a + b b b b b c c c c Operation Assignment : 3 equ. FU Constraint : 4 equ. Precedence : 8 equ. Precedence : 2 equ. ASAPALAP a12 b12 c23 + Number of registers + Spilling + Objective function + …

7 Carnegie Mellon 7 LP instead of ILP ILP hardly schedule DFT[4]… Every ILP problem can be reformulated such that it can be solved with an LP solver and keep integer solution!  LP is polynomial! Where is the catch?  Characterize integral facets: “good” inequalities  Have an objective function whose optimum lie on those facets

8 Carnegie Mellon 8 Current Implementation Simple Processor model for functional unit allocation DFT(8) do-able (1 hour) Poor Objective function  Non-integer solutions, that we fix  Lose optimality (keep good solution?)

9 Carnegie Mellon 9 What’s Left ? Get rid of non-integer solutions if possible  Get a better objective function  If not, determine if our “fixing step” is costly Add register allocation equations Deal with necessary spilling

10 Carnegie Mellon 10 Thank You! Questions?


Download ppt "Carnegie Mellon 1 Optimal Scheduling “in a lifetime” for the SPIRAL compiler Frédéric de Mesmay Theodoros Strigkos based on Y. Voronenko’s idea."

Similar presentations


Ads by Google