Skip to content

Commit

Permalink
Merge branch 'mapping_to_cgra' into time_multiplexing
Browse files Browse the repository at this point in the history
  • Loading branch information
kalhankoul96 committed Jun 16, 2024
2 parents 5ffba07 + eaf80ee commit b22d902
Show file tree
Hide file tree
Showing 10 changed files with 449 additions and 138 deletions.
4 changes: 4 additions & 0 deletions compiler/sam-kernels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ GEN_KERNEL_NAMES=(
mat_vecmul_iter
mat_vecmul_iter_short
tensor3_website_expr
mat_mask_tri_DA3sum_final
mat_mask_tri_DA3_final
)

HAND_KERNEL_NAMES=(
Expand Down Expand Up @@ -95,6 +97,8 @@ TACO_ARGS=(
"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)"
"x=Diag(i,l)*(B1(i,j)*B2(j,k)*B3(k,l)) -f=Diag:ss -f=B1:ss -f=B2:ss -f=B3:ss:1,0 -s=reorder(i,l,j,k)"
"X(i,l)=Diag(i,l)*(B1(i,j)*B2(j,k)*B3(k,l)) -f=X:ss -f=Diag:ss -f=B1:ss -f=B2:ss -f=B3:ss:1,0 -s=reorder(i,l,j,k)"
)

mkdir -p $dir
Expand Down
119 changes: 119 additions & 0 deletions compiler/sam-outputs/dot/mat_mask_tri_DA3_final.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
digraph SAM {
comment="X=ss01,Diag=ss01,B1=ss01,B2=ss01,B3=ss10"
47 [comment="type=fiberlookup,index=i,tensor=Diag,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: Diag0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="Diag" mode="0" format="compressed" src="true" root="true"]
46 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"]
45 [comment="type=broadcast" shape=point style=invis type="broadcast"]
14 [comment="type=crddrop,outer=i,inner=l" label="CrdDrop i,l" color=orange shape=box style=filled type="crddrop" outer="i" inner="l"]
2 [comment="type=fiberwrite,index=i,tensor=X,mode=0,format=compressed,segsize=2,crdsize=Diag0_dim,sink=true" label="FiberWrite i: X0\ncompressed" color=green3 shape=box style=filled type="fiberwrite" index="i" tensor="X" mode="0" format="compressed" segsize="2" crdsize="Diag0_dim" sink="true"]
1 [comment="type=fiberwrite,index=l,tensor=X,mode=1,format=compressed,segsize=Diag0_dim+1,crdsize=Diag0_dim*Diag1_dim,sink=true" label="FiberWrite l: X1\ncompressed" color=green3 shape=box style=filled type="fiberwrite" index="l" tensor="X" mode="1" format="compressed" segsize="Diag0_dim+1" crdsize="Diag0_dim*Diag1_dim" sink="true"]
44 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"]
43 [comment="type=broadcast" shape=point style=invis type="broadcast"]
41 [comment="type=repeat,index=i,tensor=B2,root=true" label="Repeat i: B2" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="B2" root="true"]
34 [comment="type=repeat,index=l,tensor=B2,root=false" label="Repeat l: B2" color=cyan2 shape=box style=filled type="repeat" index="l" tensor="B2" root="false"]
32 [comment="type=fiberlookup,index=j,tensor=B2,mode=0,format=compressed,src=true,root=false" label="FiberLookup j: B20\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B2" mode="0" format="compressed" src="true" root="false"]
30 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"]
29 [comment="type=broadcast" shape=point style=invis type="broadcast"]
16 [comment="type=crddrop,outer=j,inner=k" label="CrdDrop j,k" color=orange shape=box style=filled type="crddrop" outer="j" inner="k"]
15 [comment="type=crddrop,outer=l,inner=j" label="CrdDrop l,j" color=orange shape=box style=filled type="crddrop" outer="l" inner="j"]
28 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"]
27 [comment="type=broadcast" shape=point style=invis type="broadcast"]
25 [comment="type=repeat,index=j,tensor=Diag,root=false" label="Repeat j: Diag" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="Diag" root="false"]
17 [comment="type=repeat,index=k,tensor=Diag,root=false" label="Repeat k: Diag" color=cyan2 shape=box style=filled type="repeat" index="k" tensor="Diag" root="false"]
8 [comment="type=arrayvals,tensor=Diag" label="Array Vals: Diag" color=green2 shape=box style=filled type="arrayvals" tensor="Diag"]
7 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
6 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
5 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce"]
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*Diag0_dim*Diag1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="1*Diag0_dim*Diag1_dim" sink="true"]
26 [comment="type=repeat,index=j,tensor=B3,root=false" label="Repeat j: B3" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="B3" root="false"]
24 [comment="type=fiberlookup,index=k,tensor=B3,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: B30\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B3" mode="0" format="compressed" src="true" root="false"]
22 [comment="type=intersect,index=k" label="intersect k" color=purple shape=box style=filled type="intersect" index="k"]
21 [comment="type=broadcast" shape=point style=invis type="broadcast"]
20 [comment="type=repsiggen,index=k" label="RepeatSignalGenerator k" color=cyan3 shape=box style=filled type="repsiggen" index="k"]
19 [comment="type=broadcast" shape=point style=invis type="broadcast"]
18 [comment="type=repeat,index=k,tensor=B1,root=false" label="Repeat k: B1" color=cyan2 shape=box style=filled type="repeat" index="k" tensor="B1" root="false"]
11 [comment="type=arrayvals,tensor=B1" label="Array Vals: B1" color=green2 shape=box style=filled type="arrayvals" tensor="B1"]
10 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
9 [comment="type=mul" label="Mul" color=brown shape=box style=filled type="mul"]
12 [comment="type=arrayvals,tensor=B2" label="Array Vals: B2" color=green2 shape=box style=filled type="arrayvals" tensor="B2"]
13 [comment="type=arrayvals,tensor=B3" label="Array Vals: B3" color=green2 shape=box style=filled type="arrayvals" tensor="B3"]
23 [comment="type=fiberlookup,index=k,tensor=B2,mode=1,format=compressed,src=true,root=false" label="FiberLookup k: B21\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B2" mode="1" format="compressed" src="true" root="false"]
42 [comment="type=repeat,index=i,tensor=B3,root=true" label="Repeat i: B3" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="B3" root="true"]
40 [comment="type=fiberlookup,index=l,tensor=B3,mode=1,format=compressed,src=true,root=false" label="FiberLookup l: B31\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="l" tensor="B3" mode="1" format="compressed" src="true" root="false"]
38 [comment="type=intersect,index=l" label="intersect l" color=purple shape=box style=filled type="intersect" index="l"]
37 [comment="type=broadcast" shape=point style=invis type="broadcast"]
36 [comment="type=repsiggen,index=l" label="RepeatSignalGenerator l" color=cyan3 shape=box style=filled type="repsiggen" index="l"]
35 [comment="type=broadcast" shape=point style=invis type="broadcast"]
33 [comment="type=repeat,index=l,tensor=B1,root=false" label="Repeat l: B1" color=cyan2 shape=box style=filled type="repeat" index="l" tensor="B1" root="false"]
31 [comment="type=fiberlookup,index=j,tensor=B1,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B11\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B1" mode="1" format="compressed" src="true" root="false"]
39 [comment="type=fiberlookup,index=l,tensor=Diag,mode=1,format=compressed,src=true,root=false" label="FiberLookup l: Diag1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="l" tensor="Diag" mode="1" format="compressed" src="true" root="false"]
48 [comment="type=fiberlookup,index=i,tensor=B1,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B10\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B1" mode="0" format="compressed" src="true" root="true"]
47 -> 46 [label="crd_in-Diag" style=dashed type="crd" comment="in-Diag"]
46 -> 45 [label="crd_i" style=dashed type="crd" comment="i"]
45 -> 14 [label="crd_i" style=dashed type="crd" comment="i"]
14 -> 2 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"]
14 -> 1 [label="crd_inner-l" style=dashed type="crd" comment="inner-l"]
45 -> 44 [label="crd" style=dashed type="crd" comment=""]
44 -> 43 [label="repsig" style=dotted type="repsig"]
43 -> 41 [label="repsig" style=dotted type="repsig"]
41 -> 34 [label="ref" style=bold type="ref"]
34 -> 32 [label="ref" style=bold type="ref"]
32 -> 30 [label="crd_in-B2" style=dashed type="crd" comment="in-B2"]
30 -> 29 [label="crd_j" style=dashed type="crd" comment="j"]
29 -> 16 [label="crd_j" style=dashed type="crd" comment="j"]
16 -> 15 [label="crd_outer-j" style=dashed type="crd" comment="outer-j"]
15 -> 14 [label="crd_outer-l" style=dashed type="crd" comment="outer-l"]
29 -> 28 [label="crd" style=dashed type="crd" comment=""]
28 -> 27 [label="repsig" style=dotted type="repsig"]
27 -> 25 [label="repsig" style=dotted type="repsig"]
25 -> 17 [label="ref" style=bold type="ref"]
17 -> 8 [label="ref" style=bold type="ref"]
8 -> 7 [label="val" type="val"]
7 -> 6 [label="val" type="val"]
6 -> 5 [label="val" type="val"]
5 -> 0 [label="val" type="val"]
27 -> 26 [label="repsig" style=dotted type="repsig"]
26 -> 24 [label="ref" style=bold type="ref"]
24 -> 22 [label="crd_in-B3" style=dashed type="crd" comment="in-B3"]
22 -> 21 [label="crd_k" style=dashed type="crd" comment="k"]
21 -> 16 [label="crd_k" style=dashed type="crd" comment="k"]
21 -> 20 [label="crd" style=dashed type="crd" comment=""]
20 -> 19 [label="repsig" style=dotted type="repsig"]
19 -> 17 [label="repsig" style=dotted type="repsig"]
19 -> 18 [label="repsig" style=dotted type="repsig"]
18 -> 11 [label="ref" style=bold type="ref"]
11 -> 10 [label="val" type="val"]
10 -> 9 [label="val" type="val"]
9 -> 7 [label="val" type="val"]
22 -> 12 [label="ref_out-B2" style=bold type="ref" comment="out-B2"]
12 -> 10 [label="val" type="val"]
22 -> 13 [label="ref_out-B3" style=bold type="ref" comment="out-B3"]
13 -> 9 [label="val" type="val"]
24 -> 22 [label="ref_in-B3" style=bold type="ref" comment="in-B3"]
30 -> 18 [label="ref_out-B1" style=bold type="ref" comment="out-B1"]
30 -> 23 [label="ref_out-B2" style=bold type="ref" comment="out-B2"]
23 -> 22 [label="crd_in-B2" style=dashed type="crd" comment="in-B2"]
23 -> 22 [label="ref_in-B2" style=bold type="ref" comment="in-B2"]
32 -> 30 [label="ref_in-B2" style=bold type="ref" comment="in-B2"]
43 -> 42 [label="repsig" style=dotted type="repsig"]
42 -> 40 [label="ref" style=bold type="ref"]
40 -> 38 [label="crd_in-B3" style=dashed type="crd" comment="in-B3"]
38 -> 37 [label="crd_l" style=dashed type="crd" comment="l"]
37 -> 15 [label="crd_l" style=dashed type="crd" comment="l"]
37 -> 36 [label="crd" style=dashed type="crd" comment=""]
36 -> 35 [label="repsig" style=dotted type="repsig"]
35 -> 33 [label="repsig" style=dotted type="repsig"]
33 -> 31 [label="ref" style=bold type="ref"]
31 -> 30 [label="crd_in-B1" style=dashed type="crd" comment="in-B1"]
31 -> 30 [label="ref_in-B1" style=bold type="ref" comment="in-B1"]
35 -> 34 [label="repsig" style=dotted type="repsig"]
38 -> 25 [label="ref_out-Diag" style=bold type="ref" comment="out-Diag"]
38 -> 26 [label="ref_out-B3" style=bold type="ref" comment="out-B3"]
40 -> 38 [label="ref_in-B3" style=bold type="ref" comment="in-B3"]
46 -> 39 [label="ref_out-Diag" style=bold type="ref" comment="out-Diag"]
39 -> 38 [label="crd_in-Diag" style=dashed type="crd" comment="in-Diag"]
39 -> 38 [label="ref_in-Diag" style=bold type="ref" comment="in-Diag"]
46 -> 33 [label="ref_out-B1" style=bold type="ref" comment="out-B1"]
47 -> 46 [label="ref_in-Diag" style=bold type="ref" comment="in-Diag"]
48 -> 46 [label="crd_in-B1" style=dashed type="crd" comment="in-B1"]
48 -> 46 [label="ref_in-B1" style=bold type="ref" comment="in-B1"]
}
Loading

0 comments on commit b22d902

Please sign in to comment.