Skip to content

Commit

Permalink
Merge branch 'mapping_to_cgra' into mcoduoza-vector-accum
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoduoza committed Nov 3, 2023
2 parents 2d52bfd + aa3d1ed commit 1623d46
Show file tree
Hide file tree
Showing 23 changed files with 1,652 additions and 70 deletions.
12 changes: 12 additions & 0 deletions compiler/sam-kernels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ GEN_KERNEL_NAMES=(
mat_spacc_simple
vec_sd_compression_WRONG
vec_ds_compression_WRONG
vec_sub
mat_mask_tri
mat_mask_tri_partial
mat_vecmul_iter
mat_vecmul_iter_short
tensor3_website_expr
)

HAND_KERNEL_NAMES=(
Expand Down Expand Up @@ -83,6 +89,12 @@ TACO_ARGS=(
"X(j,k)=B(i,j,k) -f=X:ss -f=B:sss"
"x(i)=b(i) -f=b:s -f=x:d"
"x(i)=b(i) -f=b:d -f=x:s"
"x(i)=b(i)-c(i) -f=b:s -f=c:s"
"x=B(i,j)*C(i,k)*D(k,j) -f=B:ss -f=C:ss -f=D:ss:1,0 -s=reorder(i,j,k)"
"X(i,j)=B(i,j)*C(i,k)*D(k,j) -f=X:ss -f=B:ss -f=C:ss -f=D:ss:1,0 -s=reorder(i,j,k)"
"x(i)=B(i,j)*C(j,k)*D(k,l)*E(l,m)*f(m) -f=x:s -f=B:ss -f=C:ss -f=D:ss -f=E:ss -f=f:s -s=reorder(i,j,k,l,m)"
"x(i)=B(i,j)*C(j,k)*d(k) -f=x:s -f=B:ss -f=C:ss -f=d:s -s=reorder(i,j,k)"
"x=B(i)*C(j)*D(i,j,k)*E(j,l)*F(l,m,n) -f=B:s -f=C:s -f=D:sss -f=E:ss -f=F:sss -s=reorder(i,j,k,l,m,n)"
)

mkdir -p $dir
Expand Down
62 changes: 62 additions & 0 deletions compiler/sam-outputs/dot/mat_mask_tri.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
digraph SAM {
comment="x=none,B=ss01,C=ss01,D=ss10"
22 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"]
21 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"]
20 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"]
19 [comment="type=repeat,index=i,tensor=D,root=true" label="Repeat i: D" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="D" root="true"]
18 [comment="type=fiberlookup,index=j,tensor=D,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: D1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="D" mode="1" format="compressed" src="true" root="false"]
16 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"]
15 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"]
14 [comment="type=repeat,index=j,tensor=C,root=false" label="Repeat j: C" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="C" root="false"]
12 [comment="type=fiberlookup,index=k,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup k: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="C" mode="1" format="compressed" src="true" root="false"]
11 [comment="type=intersect,index=k" label="intersect k" color=purple shape=box style=filled type="intersect" index="k"]
10 [comment="type=repsiggen,index=k" label="RepeatSignalGenerator k" color=cyan3 shape=box style=filled type="repsiggen" index="k"]
9 [comment="type=repeat,index=k,tensor=B,root=false" label="Repeat k: B" color=cyan2 shape=box style=filled type="repeat" index="k" tensor="B" root="false"]
6 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"]
5 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
4 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
3 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
2 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
1 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
0 [comment="type=fiberwrite,mode=vals,tensor=x,size=1,sink=true" label="FiberWrite Vals: x" color=green3 shape=box style=filled type="fiberwrite" tensor="x" mode="vals" size="1" sink="true"]
7 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
8 [comment="type=arrayvals,tensor=D" label="Array Vals: D" color=green2 shape=box style=filled type="arrayvals" tensor="D"]
13 [comment="type=fiberlookup,index=k,tensor=D,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: D0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="D" mode="0" format="compressed" src="true" root="false"]
17 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"]
23 [comment="type=fiberlookup,index=i,tensor=C,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: C0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="C" mode="0" format="compressed" src="true" root="true"]
22 -> 21 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
21 -> 20 [label="crd" style=dashed type="crd"]
20 -> 19 [label="repsig" style=dotted type="repsig"]
19 -> 18 [label="ref" style=bold type="ref"]
18 -> 16 [label="crd_in-D" style=dashed type="crd" comment="in-D"]
16 -> 15 [label="crd" style=dashed type="crd"]
15 -> 14 [label="repsig" style=dotted type="repsig"]
14 -> 12 [label="ref" style=bold type="ref"]
12 -> 11 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
11 -> 10 [label="crd" style=dashed type="crd"]
10 -> 9 [label="repsig" style=dotted type="repsig"]
9 -> 6 [label="ref" style=bold type="ref"]
6 -> 5 [label="val" type="val"]
5 -> 4 [label="val" type="val"]
4 -> 3 [label="val" type="val"]
3 -> 2 [label="val" type="val"]
2 -> 1 [label="val" type="val"]
1 -> 0 [label="val" type="val"]
11 -> 7 [label="ref_out-C" style=bold type="ref" comment="out-C"]
7 -> 5 [label="val" type="val"]
11 -> 8 [label="ref_out-D" style=bold type="ref" comment="out-D"]
8 -> 4 [label="val" type="val"]
12 -> 11 [label="ref_in-C" style=bold type="ref" comment="in-C"]
16 -> 9 [label="ref_out-B" style=bold type="ref" comment="out-B"]
16 -> 13 [label="ref_out-D" style=bold type="ref" comment="out-D"]
13 -> 11 [label="crd_in-D" style=dashed type="crd" comment="in-D"]
13 -> 11 [label="ref_in-D" style=bold type="ref" comment="in-D"]
18 -> 16 [label="ref_in-D" style=bold type="ref" comment="in-D"]
21 -> 17 [label="ref_out-B" style=bold type="ref" comment="out-B"]
17 -> 16 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
17 -> 16 [label="ref_in-B" style=bold type="ref" comment="in-B"]
21 -> 14 [label="ref_out-C" style=bold type="ref" comment="out-C"]
22 -> 21 [label="ref_in-B" style=bold type="ref" comment="in-B"]
23 -> 21 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
23 -> 21 [label="ref_in-C" style=bold type="ref" comment="in-C"]
}
86 changes: 86 additions & 0 deletions compiler/sam-outputs/dot/mat_mask_tri_fiberwrite.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
digraph SAM {
comment="x=none,B=ss01,C=ss01,D=ss10,T=sss012"
22 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"]
21 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"]
20 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"]
19 [comment="type=repeat,index=i,tensor=D,root=true" label="Repeat i: D" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="D" root="true"]
18 [comment="type=fiberlookup,index=j,tensor=D,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: D1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="D" mode="1" format="compressed" src="true" root="false"]
16 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"]
15 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"]
14 [comment="type=repeat,index=j,tensor=C,root=false" label="Repeat j: C" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="C" root="false"]
12 [comment="type=fiberlookup,index=k,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup k: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="C" mode="1" format="compressed" src="true" root="false"]
11 [comment="type=intersect,index=k" label="intersect k" color=purple shape=box style=filled type="intersect" index="k"]
10 [comment="type=repsiggen,index=k" label="RepeatSignalGenerator k" color=cyan3 shape=box style=filled type="repsiggen" index="k"]
9 [comment="type=repeat,index=k,tensor=B,root=false" label="Repeat k: B" color=cyan2 shape=box style=filled type="repeat" index="k" tensor="B" root="false"]
6 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"]
5 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
4 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
3 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
2 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
1 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
0 [comment="type=fiberwrite,mode=vals,tensor=x,size=1,sink=true" label="FiberWrite Vals: x" color=green3 shape=box style=filled type="fiberwrite" tensor="x" mode="vals" size="1" sink="true"]
7 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
8 [comment="type=arrayvals,tensor=D" label="Array Vals: D" color=green2 shape=box style=filled type="arrayvals" tensor="D"]
13 [comment="type=fiberlookup,index=k,tensor=D,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: D0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="D" mode="0" format="compressed" src="true" root="false"]
17 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"]
23 [comment="type=fiberlookup,index=i,tensor=C,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: C0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="C" mode="0" format="compressed" src="true" root="true"]

24 [comment="type=fiberwrite,mode=0,index=i,tensor=T,format=compressed,segsize=2,crdsize=B0_dim,sink=true" label="FiberWrite i: T0" color=green3 shape=box style=filled type="fiberwrite" index="i" tensor="T" mode="0" format="compressed" segsize="2" crdsize="B0_dim" sink="true"]
25 [comment="type=fiberwrite,mode=1,index=j,tensor=T,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_dim,sink=true" label="FiberWrite j: T1" color=green3 shape=box style=filled type="fiberwrite" index="j" tensor="T" mode="1" format="compressed" segsize="B0_dim+1" crdsize="B0_dim*B1_dim" sink="true"]
26 [comment="type=fiberwrite,mode=2,index=k,tensor=T,format=compressed,segsize=B0_dim*B1_dim+1,crdsize=B0_dim*B1_dim*C1_dim,sink=true" label="FiberWrite k: T2" color=green3 shape=box style=filled type="fiberwrite" index="k" tensor="T" mode="2" format="compressed" segsize="B0_dim*B1_dim+1" crdsize="B0_dim*B1_dim*C1_dim" sink="true"]
30 [comment="type=fiberwrite,mode=vals,tensor=T,size=B0_dim*B1_dim*C1_dim,sink=true" label="FiberWrite Vals: T" color=green3 shape=box style=filled type="fiberwrite" tensor="T" mode="vals" size="B0_dim*B1_dim*C1_dim" sink="true"]

27 [comment="type=broadcast" shape=point style=invis type="broadcast"]
28 [comment="type=broadcast" shape=point style=invis type="broadcast"]
29 [comment="type=broadcast" shape=point style=invis type="broadcast"]
31 [comment="type=broadcast" shape=point style=invis type="broadcast"]

22 -> 21 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
21 -> 27 [label="crd" style=dashed type="crd"]
27 -> 20 [label="crd" style=dashed type="crd"]
27 -> 24 [label="crd" style=dashed type="crd"]

20 -> 19 [label="repsig" style=dotted type="repsig"]
19 -> 18 [label="ref" style=bold type="ref"]
18 -> 16 [label="crd_in-D" style=dashed type="crd" comment="in-D"]
16 -> 28 [label="crd" style=dashed type="crd"]
28 -> 15 [label="crd" style=dashed type="crd"]
28 -> 25 [label="crd" style=dashed type="crd"]

15 -> 14 [label="repsig" style=dotted type="repsig"]
14 -> 12 [label="ref" style=bold type="ref"]
12 -> 11 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
11 -> 29 [label="crd" style=dashed type="crd"]
29 -> 10 [label="crd" style=dashed type="crd"]
29 -> 26 [label="crd" style=dashed type="crd"]

10 -> 9 [label="repsig" style=dotted type="repsig"]
9 -> 6 [label="ref" style=bold type="ref"]
6 -> 5 [label="val" type="val"]
5 -> 4 [label="val" type="val"]
4 -> 31 [label="val" type="val"]
31 -> 3 [label="val" type="val"]
31 -> 30 [label="val" type="val"]

3 -> 2 [label="val" type="val"]
2 -> 1 [label="val" type="val"]
1 -> 0 [label="val" type="val"]
11 -> 7 [label="ref_out-C" style=bold type="ref" comment="out-C"]
7 -> 5 [label="val" type="val"]
11 -> 8 [label="ref_out-D" style=bold type="ref" comment="out-D"]
8 -> 4 [label="val" type="val"]
12 -> 11 [label="ref_in-C" style=bold type="ref" comment="in-C"]
16 -> 9 [label="ref_out-B" style=bold type="ref" comment="out-B"]
16 -> 13 [label="ref_out-D" style=bold type="ref" comment="out-D"]
13 -> 11 [label="crd_in-D" style=dashed type="crd" comment="in-D"]
13 -> 11 [label="ref_in-D" style=bold type="ref" comment="in-D"]
18 -> 16 [label="ref_in-D" style=bold type="ref" comment="in-D"]
21 -> 17 [label="ref_out-B" style=bold type="ref" comment="out-B"]
17 -> 16 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
17 -> 16 [label="ref_in-B" style=bold type="ref" comment="in-B"]
21 -> 14 [label="ref_out-C" style=bold type="ref" comment="out-C"]
22 -> 21 [label="ref_in-B" style=bold type="ref" comment="in-B"]
23 -> 21 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
23 -> 21 [label="ref_in-C" style=bold type="ref" comment="in-C"]

}
Loading

0 comments on commit 1623d46

Please sign in to comment.