1 / 24

FADA: F uzzy A rray D ataflow A nalysis. ADaAn: A rray Da taflow An alyzer.

FADA: F uzzy A rray D ataflow A nalysis. ADaAn: A rray Da taflow An alyzer. Work directed by : D. Barthou and S. Touati PRiSM laboratory - University of Versailles ARPA-informal seminar 19/02/2008. By : M. BELAOUCHA bem@prism.uvsq.fr. Introduction.

gavin
Download Presentation

FADA: F uzzy A rray D ataflow A nalysis. ADaAn: A rray Da taflow An alyzer.

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. FADA:FuzzyArray Dataflow Analysis.ADaAn:Array DataflowAnalyzer. Work directed by : D. Barthouand S. Touati PRiSM laboratory - University of Versailles ARPA-informal seminar 19/02/2008 By : M. BELAOUCHAbem@prism.uvsq.fr

  2. Introduction • Technologicalbarrier reached (soon ?) • Parallelization • Automatic (icc,…) • Bad detection [Padua, 2001, 2006] • Led by directives (OpenMP, MPI,…) • Parallelismdetection • We need an efficient Dataflow analysis method.

  3. Outline • FADA • Exact analysis • Fuzzy Analysis (FADA) • FADA Vs. State-of-art • Applications & parallel work • Implementation : ADaAn • Conclusion

  4. Dependence Analysis, the Evolution Parametric Integer Programming (PIP) Feautrier’s Exact Analysis Fuzzy Analysis : FADA Exact Analysis (PETIT) Adaptation of PETIT Parametric solver (Omega) 1990 1995 2000 ZIV, MIV, GCD, BanerjeeTest … Region Analysis (PIPS) Hybrid Analysis (Polaris)

  5. May be from S1 during (iw, jw, kw) May be from S1 during (iw, jw, kw) May be S0 during (iw, jw) Maybe S0 during (iw, jw) The exact source of T[i,j] read by S1 during iteration (ir, jr, kr) Exact Analysis (Feautrier’s modeling) Array Dataflow Analysis (ADA) Which Operation writes the value of T[i,j] read by S1 during iteration (ir, jr, kr) ? for (i=1; i<=N; i++) for (j=1; j<=M; j++){ S0: T[i,j]=0; for (k=1; k<=L; k++) S1: T[i,j] = T[i,j]+ A[i,k]*B[k,j]; } } ADA works only for static control programs P. Feautrier ”Dataflow Analysis of scalar and array references.” International Journal of Parallel Computing, 20(1):23-53, 1991.

  6. ADA-like modeling Parameterized solution FADA (Fuzzy Array Dataflow Analysis) Can <S0,iw>be the source of ‘A’ read by <S2,ir> ? for (i=1; i<=N; i++) if( c(i) ) S0: A = … ; else S1: A = …; endif S2: … = …A; endfor J-F. Collard, D. Barthou, P. Feautrier. “Fuzzy Array dataflow analysis”. ACM Symp. On Principles and Practice of Parallel Programming, 30(8):29-101, Aug. 1995.

  7. FADA’s advanced analyses • Structural Analysis • Iterative Analysis • Translating Properties Red and blue elements Blue elements Reducing Fuzziness

  8. Structural Analysis FADA proves, there is no dependence carried by the i-loop for (i=1; i<=N; i++) if( c(i) ) S0: A = … ; else S1: A = …; endif S2: … = …A; endfor Structural property of an if-then-else construct :One and only one branch can be executed during a given iteration. FADA can deduce : that the value of A read by ‘S2’ is produced during the same iteration by S0 or S1.

  9. Iterative Analysis Improved Version iterative analysis : compare two non-affine constraints by comparing the source of referenced variables (Here, A-cells). FADA proves, there is no dependence at all for (i=1; i<=N; i++){ if (A[i-1]) S0: …=…B[i-1]; if(!A[i]) S1: B[i]=…; } • FADA’s inference: • May be there is a confilct on B[i], between S0 during i+1, and S1 during i. • FADA Compares if-conditions, and deduces : • S0 can not be executed during iteration i+1 if S1 was executed during i. (for k>0 or k<1) A[i+k]=…; FADA can deduce : source of “B-cells”, read by S0, can not be an S1 operation.

  10. Translating Properties • A demonstrator, with external/internal knowledge (iterative analysis, structural analysis,…) • Desired cases : • Obtain trivial values “true/false” • Interpret all non affine constraints (and solve the rest using a parametric solver)

  11. FADA FADA, a global view Program basic analysis • advanced analyses • Structural analysis • Iterative analysis • Translating properties Exact Definitions Parameterized Definitions

  12. RO(i) WR(i) RW(i) Hybrid Analysis Rus & Rauchwerger Work Regions DS {out, anti,flow} Program USR USR DS={} No Yes • Statically : • Building: Regions, Ds And predicate DS=Empty • Dynamically : • Check the predicate and branch to the correct version PDAG Sequential Version Parallel Version USR: Uniform Sets of References PDAG: Predicate Directed Acyclic Graph DS: dependencies Set RO: Read Only WR: Write first (write, read) RW: Read first (read, write).

  13. Hybrid Analysis Vs. Fuzzy Analysis Albert don’t agree, I think that recurrence operator (On USR sets) do not handle while loops (the operator requires upper and lower bounds).

  14. FADA Vs. State of the art

  15. Outline • FADA • Applications & parallel work • Parallelism detection • Improving communications • Source to source transformations • Implementation : ADaAn • Conclusion

  16. FADA’s Applications 1. Parallelismdetection No dependence carried by the i-loop No dependence at all for (i=1; i<=N; i++) if( c(i) ) S0: A = … ; else S1: A = …; endif S3: … = …A; endfor for (i=1; i<=N; i++){ if (A[i-1]){ …=…B[i-1]; } A[i-2]=…; if(!A[i]){ B[i]=…; } } Example 1 Example 2

  17. #pragma omp nowait Applications 2. Improve synchronizations and communications • #pragma omp parallel cyclic • for (i=1; i<=N; i++){ • j=0; • while (f(A[i,j])){ • B[a[f(i)],b[j]] = … ; • j++; • } • } • #pragma omp parallel cyclic • for (i=1; i<=N; i++){ • j=0; • while (f(A[i,j])){ • …= … B[a[f(i)],b[j]] ; • j++; • } • } We can remove the implicit barrier

  18. Applications 3. Source-to-source transformations A simplified deep-jam example

  19. Dependencies are preserved ? X2(j”) X1(j’) X3(j”’) S0’ S0’’ X4(j””) X(j) • True : Validate the step • False : Reject The transformation • Demonstration not achieved • Generate appropriate code to correct transformed program. S0 Y1(i’) Y(i) Y2(i””) Y3(i’”) Y2(i’’) S1 S1’ S1’’ Irregular code transformation Main idea G G’

  20. Outline • FADA • Applications & parallel work • ADaAn • Input • Preprocessing • output • Conclusion

  21. ADaAn Input file PROGRAM ADaAn_input; BEGIN for(i:1:N){ S0: j=0; /*labled statement*/ [do whith j] while(C(i,j)){ if (a[i,j]){ A[i,j] += B[i,j]; }else{ A[i,b[j]] = 5; }; j++; }; }; END ADaAn (Array Dataflow Analyzer) Overview Program Preprocessing FADA’s basic analysis PIPlib BeeCl@ck Polylib FADA’s advanced analyses SWI-PROLOG Verification code Definitions Dependence graph

  22. Preprocessing step : Single loop counter ID and loop normalization ADaAn Preprocessing step : Advanced symbolic constants identification Preprocessing step : Automatic symbolic constants identification C=…; for (i:1:N){ …=…i; C=…C; }; C=C…; for (i:N-50:N){ …=…C; }; C=…; for (i:1:N){ …=…i; C=…C; }; C1=C…; for (i:N-50:N){ …=…C1; }; For(i:1:N){ j=0; while (C(i,j)){ …=…T[i]; …=…V; j++; }; V=…; }; … for (i:1:N){ …=…i; }; … for (i:lb(…):ub(…)){ …=…i; }; … for (i:1:N){ …=…i; }; … for (i0:0:ub(…)-lb(…)){ …=…i0-lb(…); }; ADaAn (Array Dataflow Analyzer) Overview Program Preprocessing FADA’s basic analysis PIPlib BeeCl@ck Polylib FADA’s advanced analyses SWI-PROLOG Verification code Definitions Dependence graph

  23. ADaAn ADaAn Output Program Preprocessing FADA’s basic analysis PIPlib BeeCl@ck Polylib FADA’s advanced analyses SWI-PROLOG Verification code Definitions Dependence graph

  24. ADaAn In progress • Achieved • Basic analysis • Structural Analysis • In progress • Parametric PROLOG-like demonstrator (for : Iterative analysis and Translating properties)

More Related