Team 8 Data Dependence Analysis - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Team 8 Data Dependence Analysis

Description:

Omega Test Real 'Shadow' Project the original problem onto a lower dimension (cast its shadow) ... Omega test for solving systems of equations ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 35
Provided by: georgezo
Category:

less

Transcript and Presenter's Notes

Title: Team 8 Data Dependence Analysis


1
Team 8Data Dependence Analysis
  • Shrinand Vyas
  • Srikanth Mandava
  • Sumana Ponnoju
  • Tushar Pradhan
  • Udit Patidar (L)

2
Flow of the Presentation
  • Need for Data Dependence
  • What is Data Dependence and its types
  • Methods for Data Dependence Testing
  • Theoretical Background of Tests
  • Limitations of Data Dependence Testing
  • Examples
  • Work Done
  • (?) Questions and Answers

3
Questions to answer
  • Study dependence testing for arrays. What are the
    corresponding tests for scalars?
  • Investigate the dependence tests inside the
    Open64 compiler, how and where they are performed
    and how array/scalar dependences are stored.
  • Determine how the distance and direction vectors
    are computed and stored
  • Briefly identify the parts of the compiler use
    the dependence testing.
  • Identify loops that have no dependences with
    distances greater than one.
  • Export the required information and create an
    interface in the Dragon tool to display it.
  • Test your work with different applications

4
Importance Need ofData Dependence Analysis
  • Instruction Scheduling
  • Loop Nest Optimisation (LNO) (Team1)
  • Loop Transformations (Team1)
  • Parallelisation (Team3)
  • Data Cache Optimisation

5
Instruction Scheduling Example
1 r2 ? r1 (4) 2 r3 ? r14 (4) 3 r4 ? r2
r3 4 r5 ? r2 - 1 5 goto L1 6 nop
1 r2 ? r1 (4) 2 r3 ? r14 (4) 3 r5 ? r2 -
1 4 goto L1 5 r4 ? r2 r3
6
Data Cache Optimization Example
  • / Array is Accessed Here.. /
  • ...
  • for (i0ilt100i)
  • / Array is Accessed Here.. /
  • / Array is Accessed Here.. /

7
What is Data Dependence Analysis?
  • Data dependence analysis determines when two
    different expressions in program will refer to
    the same data element
  • S1 a ? b c
  • S2 if (a gt 10) goto L1
  • S3 d ? b e
  • S4 e ? d 1
  • S5 L1 d ? e / 2

Remember? Slides from 29 March.
8
Types of Data Dependence
  • True Dependence (t)
  • Anti Dependence (a)
  • Input Dependence (i)
  • Output Dependence (o)

9
Types of Data Dependence
  • S1 a ? b c
  • S2 if (a gt 10) goto L1
  • S3 d ? b e
  • S4 e ? d 1
  • S5 L1 d ? e / 2

10
Loop Based Dependencies
  • Distance Vector
  • Direction Vector
  • eg a(i,j)
  • a(i2,j-1)
  • Distance Vector ? (2,-1)
  • Direction Vector ? (gt,lt)

Q) Determine how the distance and direction
vector are computed and stored
11
Dependence Tests
  • SCALARS
  • DEF-USE chains
  • Data-flow analysis
  • ARRAYS
  • Lamports Test
  • GCD Test
  • Banerjees Inequalities
  • Extended GCD Test
  • Power Test
  • I-Test
  • Omega Test
  • Range Test
  • Delta Test
  • etc

Q) Study dependence testing for arrays. What are
the corresponding tests for scalars?
12
The GCD test
  • Easiest test used to determine the dependence
  • Given the following equation ais and c are
    integers
  • does gcd(a1,a2,,an) divide c
  • If YES an integer solution exists and we have
    dependence
  • else we do not have dependence

13
GCD Test Example
  • DO i 1,10
  • a(2i) b(i) c(i)
  • d(i) a(2i-1)
  • END DO
  • We need to look at the following
  • Does GCD(2,2) divide -1?
  • NO ? we do not have dependence!!

14
Dependence Tests
  • Lamports Test
  • GCD Test
  • Banerjees Inequalities
  • Extended GCD Test
  • Power Test
  • I-Test
  • Omega Test
  • Range Test
  • Delta Test
  • etc

Q) Investigate the dependence tests inside the
Open64 compiler,
15
Banerjees Extended GCD Test
  • GCD test extended to multi-dimensional arrays
  • Reduce the dimensionality of the original GCD
    test
  • Reduces complexity
  • Still an inexact test

Maydan, Hennessy, Lam, Efficient and Exact Data
Dependence Analysis (1991)
16
Extended GCD Test Example
  • DO i 1,10
  • a(i) b(i) c(i)
  • d(i) a(i-1)
  • END DO
  • Consider loop bounds as well.
  • Look at the following
  • i1i2-1, 1 i1, i2 10
  • Transform, (i1,i2)(t1,t11)
  • So, we reduce to 1 t1 10
  • 1 t110 10

17
Dependence Tests
  • Lamports Test
  • GCD Test
  • Banerjees Inequalities
  • Extended GCD Test
  • Power Test
  • I-Test
  • Omega Test
  • Range Test
  • Delta Test
  • etc

18
Omega Test
  • Used to determine dependencies in a system of
    equations
  • Basic idea
  • Pre-process
  • Pick one variable and eliminate it
  • Continue until all variables but one are
    eliminated

Pugh, The Omega Test a fast and practical
integer programming algorithm for dependence
analysis (1993)
19
Omega Test Main Idea
20
Omega Test Real Shadow
?
CheckREAL shadow
  • Project the original problem onto a lower
    dimension (cast its shadow)
  • All points inside the shadow ? Real Shadow
  • No integer solution ? Original Problem has no
    solution

21
Omega Test Dark Shadow
?
No integersolution?
CheckREAL shadow
UNSAT
Integer solution
?
CheckDARK shadow
  • An integer solution for the REAL shadowdoes not
    guarantee that there is an integer solution for
    the original problem
  • What is the dark shadow?

22
Omega Test Grey Shadow
?
No integersolution?
CheckREAL shadow
UNSAT
Integer solution
?
Integersolution?
CheckDARK shadow
SAT
No Integer solution
?
CheckGREY shadow
  • If the real shadow R has integer solutions,but
    the dark shadow D does not, search R-D

23
Example of Omega Test
  • DO i1,6
  • a(i1)
  • a(7i-6)
  • END DO
  • With GCD test, we will get i17i-6
  • GCD(1,-7)1, which divides -7
  • Omega test is able to disprove the dependence in
    this case

Psarris, Kyriakopoulos, Measuring the Accuracy
and Efficiency of Data Dependence Tests (2001)
24
Limitations of Dependence Testing
  • No inter-loop dependence testing yet
  • Can not handle procedure calls
  • Expression must be linear
  • aixiajxj works
  • aij doesnt work
  • Non-linear algorithms exist

William Blume, Rudolf Eigenmann Non-Linear and
Symbolic Data Dependence Testing (1998)
25
Inside our OpenUH compiler
  • Trivial cases
  • Symbolic terms
  • Non-equal constants ? independent
  • Else ? continue testing
  • Base test
  • GCD test
  • Omega test for solving systems of equations

UH?CS Department?HPC Tools Group, Overview of
the Open64 Compiler Infrastructure
26
(No Transcript)
27
Inside our OpenUH compiler
Q) Briefly identify the parts of the compiler
used during dependence testing.
28
Dragon Analysis Tool
  • Displays data dependence information
  • Commands required
  • uhcc O2 ipa dragon for generating .d
  • uhcc O3 dragon for generating .dep

29
Dragon Analysis Tool Output
30
Project phase
  • Q) Identify loops that have no dependences
  • with distances greater than one
  • Loop Carried Dependencies
  • function Loop_Carrying_Dependence()
  • If distance gt 1 then dependence is across
    iterations
  • Q) Export the required information and
  • create an interface in the Dragon tool
  • to display it
  • We were able to dump the info onto the console

31
Dragon Analysis Tool Output
32
Concluding work
  • Capture output from console into dep_graph.cxx
  • Edit outfile.write directive to release/withhold
    required information
  • Write report!!

33
References
  • UH CS Department UPC Tools Group, Overview of the
    Open64 Compiler Infrastructure
  • William Blume, Rudolf Eigenmann Non-Linear and
    Symbolic Data Dependence Testing (1998)
  • Maydan, Hennessy, Lam, Efficient and Exact Data
    Dependence Analysis (1991)
  • Psarris, Kyriakopoulos, Measuring the Accuracy
    and Efficiency of Data Dependence Tests (2001)
  • Pugh, The Omega Test a fast and practical
    integer programming algorithm for dependence
    analysis (1993)

34
Acknowledgments
  • Thanks to
  • Oscar Hernandez
  • Dr Chapman
  • QA
Write a Comment
User Comments (0)
About PowerShow.com