Practical Dependence Test
description
Transcript of Practical Dependence Test
![Page 1: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/1.jpg)
Practical Dependence Test
Gina Goff, Ken Kennedy, Chau-Wen TsengPLDI ’91
presented byChong Liang Ooi
![Page 2: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/2.jpg)
Contribution
Efficient and precise dependence test is essential
General tests (Banerjee and GCD) are unnecessary
Most array refs in scientific Fortran program are simple
Based on these simple cases, this paper proposedPartition-Based Algorithm
![Page 3: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/3.jpg)
Classification of Subscripts
1. ComplexityNo of unique array indices a subscript hasi. ZIV– Zero Index Variableii. SIV – Single Index Variableiii. MIV – Multiple Index Variable
DO 10 i
DO 10 j
DO 10 k
10 A(5, i+1, j) = A(N, i, k) + c
![Page 4: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/4.jpg)
Classification of Subscripts
2. Separability
Separable if indices do not occur in other subscriptOtherwise, coupled
A(i, j, j) = A(i, j, k) + c
![Page 5: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/5.jpg)
Partition-Based Algorithm
Partition subscripts separable & minimal coupled group
Label each subscript as ZIV, SIV or MIV
Apply Single Subscript Test based on complexity
Apply Multiple Subscript Test to coupled group
If any test yields independence, no dependence exist
Otherwise, merge all direction vectors into single set
![Page 6: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/6.jpg)
Single Subscript Test – ZIV
ZIV takes 2 loop invariant expressions
Proves 2 expressions cannot be equal
Can be extended for symbolic expressions
If differences is non-zero constant independence
![Page 7: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/7.jpg)
SS Test – Strong SIV
Ref pair of form: <ai+c1, ai’+c2> for a Є [1,10]
Dependence Distance, d = i’-i = (c1-c2)/a
Dependence exist, if |d| <= U - LDependence Direction =
< if d > 0= if d = 0> if d < 0
Exact & efficientExtendable to Symbolic Expr by eval d symbolically
![Page 8: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/8.jpg)
SS Test – Weak-Zero SIV
Ref pair of form: <a1i+c1, a2i’+c2> for a1 != a2
a1i+c1=a2i’+c2 is a line in 2D space of i vs i’
Check whether line intersect with any integer points
Weak-zero SIVFor a1=0 or a2=0
Let a2=0 i=(c2-c1 )/a1
Check i Є I and |i| < U - L
![Page 9: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/9.jpg)
SS Test – Weak-Zero SIV
Usually, i=0 or last iterationLoop peeling transformation can help
DO 10 i=1, N10 Y(i, N)=Y(1,N)+Y(N,N)
Y(1,N)=Y(1,N)+Y(N,N)DO 10 i=2, N-1
10 Y(i, N)=Y(1,N)+Y(N,N)Y(N,N)=Y(1,N)+Y(N,N)
![Page 10: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/10.jpg)
SS Test – Weak-Crossing SIV
Weak-Crossing SIVFor a2 = -a1
Let i=i’ i=(c2-c1 )/2a1
Check |i| < U – L and i Є I or 1/2
Typically in Choleskey decomposition
![Page 11: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/11.jpg)
SS Test – Weak-Crossing SIV
Loop splitting transformation can help
DO 10 i=1, N10 A(i)=A(N-i+1)+C
DO 10 i=1, (N+1)/210 A(i)=A(N-i+1)+C
DO 20 i=(N+1)/2+1, N20 A(i)=A(N-i+1)+C
![Page 12: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/12.jpg)
SS Test – Restricted Double Index Var
Ref pair of form: <a1i+c1, a2j+c2>
SIV Tests can be used with 2 loop bounds for i & j
![Page 13: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/13.jpg)
Coupled Subscripts – Delta TestSubscript-by-subscript test may yield false dep.Delta Test Algorithm
![Page 14: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/14.jpg)
Delta Test ConstraintsAssertions on indices derived from subscripts<a1i+c1, a2i’+c2> a1i - a2i’= c2 - c1
Constraint vector, C=(del1, del2, …)
one constraint for each index in the coupled group
Del can bedependence line: <ax+by=c>dependence distance: <d>dependence point: <x,y>
![Page 15: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/15.jpg)
Intersecting Delta Test ConstraintsIf the intersect of all constraints is empty set
no dependence
![Page 16: Practical Dependence Test](https://reader035.fdocuments.in/reader035/viewer/2022062809/5681587a550346895dc5da2e/html5/thumbnails/16.jpg)
The End
Questions?