1 / 47

Ordonnancement de systèmes Alpha structurés

Ordonnancement de systèmes Alpha structurés. Patrice Quinton, Tanguy Risset Séminaire Roscoff. Outline. Cyclic scheduling: state of the art Scheduling in MMAlpha Experiments in MMAlpha. Review: affine dependences. Feautrier 92 Farkas Lemma Darte 92 Duality fundamental theorem

Télécharger la présentation

Ordonnancement de systèmes Alpha structurés

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ordonnancement de systèmes Alpha structurés Patrice Quinton, Tanguy Risset Séminaire Roscoff Patrice Quinton, Tanguy Risset

  2. Outline • Cyclic scheduling: state of the art • Scheduling in MMAlpha • Experiments in MMAlpha Patrice Quinton, Tanguy Risset

  3. Review: affine dependences • Feautrier 92 • Farkas Lemma • Darte 92 • Duality fundamental theorem • Mauras, Quinton, Rajopadhye, Saouter 91 • dual representation of polyhedra • Do not handle resource constraints Patrice Quinton, Tanguy Risset

  4. Scheduling in CAD community • Schedule of an acyclic graph under resource constraints • Heuristics: • list scheduling, FDS, Sim. Al. • Exact method: • Integer linear programming • Does not handle loops Patrice Quinton, Tanguy Risset

  5. Scheduling in the compiler community • Problem tackled: • instruction level parallelism • resource constraints or register constraints • Software pipelining + loop unrolling • heuristics • integer linear programming • One single uniform loop Patrice Quinton, Tanguy Risset

  6. Recent work: exact solution • Dirk Fimmel, Jan Muller: • solve resource constraints, register constraints and initiation interval in a single ILP: • minimize latency with respect to dependences, register and resource constraints. Patrice Quinton, Tanguy Risset

  7. Duration 1 4 2 6 10 14 Recent work: heuristics • Gasperoni, Eisenbeis, Darte & Robert • transform the cyclic 1D problem into an acyclic one Patrice Quinton, Tanguy Risset

  8. 12k 12(k+1) time Ak Ak+1 Dk-1 Bk Ck Dk BK+1 Ck+1 Ek Fk Fk-1 Ek+1 Fk+1 =12 ressources Recent work: heuristics Patrice Quinton, Tanguy Risset

  9. time 24(k+1) 24k Dk-1 Ek Ck Ak Dk Ek Fk Ek+1 =24 ressources Resource constrained scheduling Patrice Quinton, Tanguy Risset

  10. Questions • How do we adapt these theories • software pipelining • resource constraints scheduling to polyedral hardware generation with MMAlpha? Patrice Quinton, Tanguy Risset

  11. Outline • Cyclic scheduling: state of the art • Scheduling in MMAlpha • Experiments in MMAlpha Patrice Quinton, Tanguy Risset

  12. Classical linear schedule in MMAlpha design flow Patrice Quinton, Tanguy Risset

  13. Duration 1 4 2 6 10 14 Classical linear schedule in MMAlpha design flow Patrice Quinton, Tanguy Risset

  14. 6 2 C D 2 1 1 0 1 A B F E 2 0 0 10 1 4 14 Classical linear schedule in MMAlpha design flow Patrice Quinton, Tanguy Risset

  15. Classical linear schedule in MMAlpha design flow schedule[ scheduleType -> sameLinearPart, durations -> {0,0,1,4,2,6,10,14,0,0}, addConstraints -> {/* linear constraints */} ] Patrice Quinton, Tanguy Risset

  16. Multi-dimensional scheduling • Virtual clock counter is a vector (hours, minutes,….) t2 N t1 N Patrice Quinton, Tanguy Risset

  17. Multi-dimensional scheduling • Useful for • Fast prototyping of parallelism in complex applications • SVD (S. Robert, 1997) • Kalman filtering (A. Mozipo, 1998) • Efficient code generation • Quilleré 1999 • Structured scheduling Patrice Quinton, Tanguy Risset

  18. Extension to structured scheduling • Structured systems of recurrence equations (Dinechin97) • Example: • matrix product can be expressed as N2 independent dot products. • Question: • Provided we have a layout for the dot product, can we use it for matrix product? Patrice Quinton, Tanguy Risset

  19. Example: Matrix-Matrix product {i,j,k|1<=i,j,k<=N}: A[i,j,k] = A[i,j-1,k-1]; {i,j,k|1<=i,j,k<=N}: B[i,j,k] = B[i-1,j,k-1]; {i,j,k|1<=i,j,k<=N}: C[i,j,k] = C[i,j,k-1]*A[i,j,k]*B[i,j,k]; {i,j|1<=i,j<=N}: c[i,j] = C[i,j,N]; Patrice Quinton, Tanguy Risset

  20. k j c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) i 0 Example: Matrix-Matrix product Patrice Quinton, Tanguy Risset

  21. k c a(4) b(4) a(3) b(3) a(2) b(2) a(1) b(1) 0 Alpha code for dot product Patrice Quinton, Tanguy Risset

  22. k c a(4) b(4) a(3) b(3) a(2) b(2) a(1) b(1) 0 Alpha code for dot product system dot:{N|1<=N} (a,b:{k|1<=k<=N} of integer)returns (c: integer); var Acc:{k|0<=k<=N} of integer; let Acc[k] = case {|k=0}:0[]; {|k>0}:Acc[k-1]+a[k]*b[k]; esac; c[]=Acc[N]; tel; Patrice Quinton, Tanguy Risset

  23. k j c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) B(1,1,2) A(1,1,2) A(1,1,1) B(1,1,1) i 0 Matrix product using dot product {i,j,k|1<=i,j,k<=N}: A[i,j,k] = A[i,j-1,k-1]; {i,j,k|1<=i,j,k<=N}: B[i,j,k] = B[i-1,j,k-1]; use {i,j|1<=i<=N} dot[N](A,B) returns (C); Patrice Quinton, Tanguy Risset

  24. DG: A B ACC C Structured dependence graph Patrice Quinton, Tanguy Risset

  25. DG: A B SDG: A B ACC C C Structured dependence graph Patrice Quinton, Tanguy Risset

  26. What is a structured scheduling? • Schedule each computation such that • dependencies are satisfied • timing functions are positive • All instances of a given subsystem have the same schedule • Schedule is built from the structured dependence graph. Patrice Quinton, Tanguy Risset

  27. Necessary form of a structured scheduling This form can be imposed by means of linear constraints use {i,j|1<=i<=N} dot[N](A,B) returns (C); Patrice Quinton, Tanguy Risset

  28. k c a(4) b(4) a(3) b(3) a(2) b(2) a(1) b(1) 0 Schedule of the dot product Patrice Quinton, Tanguy Risset

  29. Structured 1D schedule use {i,j|1<=i<=N} dot[N](A,B) returns (C); Patrice Quinton, Tanguy Risset

  30. 2D schedule use {i,j|1<=i<=N} dot[N](A,B) returns (C); Patrice Quinton, Tanguy Risset

  31. c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) 0 How to interpret this? k j i Patrice Quinton, Tanguy Risset

  32. c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) 0 j=1 k j i Patrice Quinton, Tanguy Risset

  33. c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) 0 j=1 k j i Patrice Quinton, Tanguy Risset

  34. c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) 0 j=1 k j i Patrice Quinton, Tanguy Risset

  35. c[1,1] A(1,1,4) B(1,1,4) A(1,1,3) B(1,1,3) A(1,1,2) B(1,1,2) A(1,1,1) B(1,1,1) 0 j=1 k j i Patrice Quinton, Tanguy Risset

  36. j=2 j k i Patrice Quinton, Tanguy Risset

  37. j=3 k j i Patrice Quinton, Tanguy Risset

  38. Matrix product re-using hardware Matrix product C B*,* C1,* C2,* C3,* A1,* A2,* A3,* Acc + * B A Dot product Patrice Quinton, Tanguy Risset

  39. Advantage of structured scheduling • Preserves designer’s structuring • Re-uses hardware • Constraints are linear • uses a classical schedule tool • Reduces the schedule computation complexity • Improves readability of the schedule information Patrice Quinton, Tanguy Risset

  40. Outline • Cyclic scheduling: state of the art • Scheduling in MMAlpha • Experiments in MMAlpha Patrice Quinton, Tanguy Risset

  41. Experiments • Vertex method: Simplex of Mathematica • Farkas method: Pip software • Evaluation of structured vs « flat » scheduling Patrice Quinton, Tanguy Risset

  42. Test set (vertex method) Patrice Quinton, Tanguy Risset

  43. #Constraints vs #Variables Patrice Quinton, Tanguy Risset

  44. Schedule time vs #constraints Patrice Quinton, Tanguy Risset

  45. #Constraints vs #Variables (Farkas method) Patrice Quinton, Tanguy Risset

  46. Schedule time vs #constraints Patrice Quinton, Tanguy Risset

  47. Flat vs structured schedule Patrice Quinton, Tanguy Risset

More Related