Skip to content

Commit

Permalink
Merge branch 'mapping_to_cgra' into add_sparse_ml_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcheng15 committed Mar 11, 2024
2 parents 4c39d05 + d4a9853 commit 50f79ea
Show file tree
Hide file tree
Showing 20 changed files with 841 additions and 138 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: 3.8.12
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
pip install --upgrade pip
Expand Down Expand Up @@ -46,7 +42,7 @@ jobs:
done < ${GITHUB_WORKSPACE}/scripts/tensor_names/suitesparse_ci.txt
- name: Lint with flake8
run: |
conda install flake8
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude venv,peak,lassen
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
Expand Down
19 changes: 3 additions & 16 deletions compiler/sam-outputs/onyx-dot/mat_elemadd_leakyrelu_exp.gv
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ digraph SAM {
4 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"]
3 [comment="type=fp_add" label="FP_Add" color=brown shape=box style=filled type="fp_add"]
12 [comment="broadcast" shape=point style=invis type="broadcast"]
13 [comment="type=fp_mul,rb_const=0.2" label="FP_Mul * 0.2" color=brown shape=box style=filled type="fp_mul" rb_const="0.2"]
13 [comment="type=fp_mul,const0=0.2" label="FP_Mul * 0.2" color=brown shape=box style=filled type="fp_mul" const0="0.2"]
14 [comment="type=fp_max" label="FP_Max" color=brown shape=box style=filled type="fp_max"]
15 [comment="type=fp_mul,rb_const=1.44269504089" label="FP_Mul * 1.44269504089" color=brown shape=box style=filled type="fp_mul" rb_const="1.44269504089"]
16 [comment="type=broadcast" shape=point style=invis type="broadcast"]
17 [comment="type=fgetfint" label="Fgetfint" color=brown shape=box style=filled type="fgetfint"]
18 [comment="type=fgetffrac" label="Fgetffrac" color=brown shape=box style=filled type="fgetffrac"]
19 [comment="type=and,rb_const=255" label="And 0x00FF" color=brown shape=box style=filled type="and" rb_const="255"]
20 [comment="type=faddiexp" label="Faddiexp" color=brown shape=box style=filled type="faddiexp"]
21 [comment="type=arrayvals,tensor=exp" label="Array Vals: exp" color=green2 shape=box style=filled type="arrayvals" tensor="exp"]
15 [comment="type=exp" label="Exp" color=brown shape=box style=filled type="exp"]
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*B0_dim*B1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="1*B0_dim*B1_dim" sink="true"]
5 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
8 [comment="type=fiberlookup,index=j,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="C" mode="1" format="compressed" src="true" root="false"]
Expand All @@ -34,14 +28,7 @@ digraph SAM {
12 -> 14 [label="val" type="val"]
13 -> 14 [label="val" type="val"]
14 -> 15 [label="val" type="val"]
15 -> 16 [label="val" type="val"]
16 -> 17 [label="val" type="val"]
16 -> 18 [label="val" type="val"]
18 -> 19 [label="val" type="val"]
19 -> 21 [label="ref" style=bold type="ref"]
21 -> 20 [label="val" type="val" comment="fp"]
17 -> 20 [label="val" type="val" comment="exp"]
20 -> 0 [label="val" type="val"]
15 -> 0 [label="val" type="val"]
6 -> 5 [label="ref_out-C" style=bold type="ref" comment="out-C"]
5 -> 3 [label="val" type="val"]
7 -> 6 [label="ref_in-B" style=bold type="ref" comment="in-B"]
Expand Down
2 changes: 1 addition & 1 deletion compiler/sam-outputs/onyx-dot/mat_elemadd_relu.gv
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ digraph SAM {
5 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
8 [comment="type=fiberlookup,index=j,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="C" mode="1" format="compressed" src="true" root="false"]
11 [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"]
12 [comment="type=max" label="Max 0" color=brown shape=box style=filled type="max"]
12 [comment="type=smax,const0=0" label="Max 0" color=brown shape=box style=filled type="smax", const0="0"]
13 [comment="type=crddrop,outer=j,inner=val,mode=0" label="CrdDrop Compression j, val" color=orange style=filled type="crddrop" outer="j" inner="val" mode="0"]
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*B0_dim*B1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="2*B0_dim*B1_dim" sink="true"]
14 [comment="type=crddrop,outer=i,inner=j" label="CrdDrop i,j" color=orange shape=box style=filled type="crddrop" outer="i" inner="j"]
Expand Down
55 changes: 55 additions & 0 deletions compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_fp.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
digraph SAM {
comment="X=ss01,B=ss01,C=ss10"
17 [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"]
16 [comment="type=broadcast" shape=point style=invis type="broadcast"]
2 [comment="type=fiberwrite,index=i,tensor=X,mode=0,format=compressed,segsize=2,crdsize=B0_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="B0_dim" sink="true"]
15 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"]
14 [comment="type=repeat,index=i,tensor=C,root=true" label="Repeat i: C" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="C" root="true"]
13 [comment="type=fiberlookup,index=j,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="C" mode="1" format="compressed" src="true" root="false"]
12 [comment="type=broadcast" shape=point style=invis type="broadcast"]
1 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*C1_dim,sink=true" label="FiberWrite j: X1\ncompressed" color=green3 shape=box style=filled type="fiberwrite" index="j" tensor="X" mode="1" format="compressed" segsize="B0_dim+1" crdsize="B0_dim*C1_dim" sink="true"]
11 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"]
10 [comment="type=repeat,index=j,tensor=B,root=false" label="Repeat j: B" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="B" root="false"]
8 [comment="type=fiberlookup,index=k,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup k: B1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B" mode="1" format="compressed" src="true" root="false"]
7 [comment="type=intersect,index=k" label="intersect k" color=purple shape=box style=filled type="intersect" index="k"]
5 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"]
4 [comment="type=fp_mul" label="FP_Mul" color=brown shape=box style=filled type="fp_mul"]
3 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce", fp="true"]
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*B0_dim*C1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="1*B0_dim*C1_dim" sink="true"]
6 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
9 [comment="type=fiberlookup,index=k,tensor=C,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: C0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="C" mode="0" format="compressed" src="true" root="false"]
18 [comment="type=crddrop,outer=i,inner=j" label="CrdDrop i,j" color=orange shape=box style=filled type="crddrop" outer="i" inner="j"]
19 [comment="type=crddrop,outer=j,inner=k" label="CrdDrop j,k" color=orange shape=box style=filled type="crddrop" outer="j" inner="k"]

17 -> 16 [label="crd" style=dashed type="crd" comment=""]
# 16 -> 2 [label="crd" style=dashed type="crd"]
16 -> 15 [label="crd" style=dashed type="crd"]
15 -> 14 [label="repsig" style=dotted type="repsig"]
14 -> 13 [label="ref" style=bold type="ref"]
13 -> 12 [label="crd" style=dashed type="crd" comment=""]
# 12 -> 1 [label="crd" style=dashed type="crd"]
12 -> 11 [label="crd" style=dashed type="crd"]
11 -> 10 [label="repsig" style=dotted type="repsig"]
10 -> 8 [label="ref" style=bold type="ref"]
8 -> 7 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
7 -> 5 [label="ref_out-B" style=bold type="ref" comment="out-B"]
5 -> 4 [label="val" type="val"]
# 4 -> 3 [label="val" type="val"]
3 -> 0 [label="val" type="val"]
7 -> 6 [label="ref_out-C" style=bold type="ref" comment="out-C"]
6 -> 4 [label="val" type="val"]
8 -> 7 [label="ref_in-B" style=bold type="ref" comment="in-B"]
13 -> 9 [label="ref" style=bold type="ref" comment=""]
9 -> 7 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
9 -> 7 [label="ref_in-C" style=bold type="ref" comment="in-C"]
17 -> 10 [label="ref" style=bold type="ref" comment=""]

4 -> 19 [label="val_inner-k" type="val" comment="inner-k"]
12 -> 19 [label="crd_outer-j" style=dashed type="crd" comment="outer-j"]
18 -> 1 [label="crd_inner-j" style=dashed type="crd" comment="inner-j"]
19 -> 3 [label="val_inner-k" type="val" comment="inner-k"]

19 -> 18 [label="crd_inner-j" style=dashed type="crd" comment="inner-j"]
16 -> 18 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"]
18 -> 2 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"]
}
2 changes: 1 addition & 1 deletion compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ digraph SAM {
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*B0_dim*C1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="1*B0_dim*C1_dim" sink="true"]
6 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
9 [comment="type=fiberlookup,index=k,tensor=C,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: C0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="C" mode="0" format="compressed" src="true" root="false"]
20 [comment="type=max" label="Max 0" color=brown shape=box style=filled type="max"]
20 [comment="type=smax,const0=0" label="Max 0" color=brown shape=box style=filled type="smax", const0="0"]
21 [comment="type=crddrop,outer=j,inner=val,mode=0" label="CrdDrop Compression j, val" color=orange style=filled type="crddrop" outer="j" inner="val" mode="0"]
22 [comment="type=crddrop,outer=i,inner=j" label="CrdDrop i,j" color=orange shape=box style=filled type="crddrop" outer="i" inner="j"]
17 -> 16 [label="crd" style=dashed type="crd" comment=""]
Expand Down
54 changes: 54 additions & 0 deletions compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu_fp.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
digraph SAM {
comment="X=ss01,B=ss01,C=ss10"
17 [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"]
16 [comment="type=broadcast" shape=point style=invis type="broadcast"]
2 [comment="type=fiberwrite,index=i,tensor=X,mode=0,format=compressed,segsize=2,crdsize=B0_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="B0_dim" sink="true"]
15 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"]
14 [comment="type=repeat,index=i,tensor=C,root=true" label="Repeat i: C" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="C" root="true"]
13 [comment="type=fiberlookup,index=j,tensor=C,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: C1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="C" mode="1" format="compressed" src="true" root="false"]
12 [comment="type=broadcast" shape=point style=invis type="broadcast"]
1 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*C1_dim,sink=true" label="FiberWrite j: X1\ncompressed" color=green3 shape=box style=filled type="fiberwrite" index="j" tensor="X" mode="1" format="compressed" segsize="B0_dim+1" crdsize="B0_dim*C1_dim" sink="true"]
11 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"]
10 [comment="type=repeat,index=j,tensor=B,root=false" label="Repeat j: B" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="B" root="false"]
8 [comment="type=fiberlookup,index=k,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup k: B1\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B" mode="1" format="compressed" src="true" root="false"]
7 [comment="type=intersect,index=k" label="intersect k" color=purple shape=box style=filled type="intersect" index="k"]
5 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"]
4 [comment="type=fp_mul" label="FP_Mul" color=brown shape=box style=filled type="fp_mul"]
3 [comment="type=reduce" label="Reduce" color=brown shape=box style=filled type="reduce", fp="true"]
0 [comment="type=fiberwrite,mode=vals,tensor=X,size=1*B0_dim*C1_dim,sink=true" label="FiberWrite Vals: X" color=green3 shape=box style=filled type="fiberwrite" tensor="X" mode="vals" size="1*B0_dim*C1_dim" sink="true"]
6 [comment="type=arrayvals,tensor=C" label="Array Vals: C" color=green2 shape=box style=filled type="arrayvals" tensor="C"]
9 [comment="type=fiberlookup,index=k,tensor=C,mode=0,format=compressed,src=true,root=false" label="FiberLookup k: C0\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="C" mode="0" format="compressed" src="true" root="false"]
20 [comment="type=smax,const0=0" label="Max 0" color=brown shape=box style=filled type="smax", const0="0"]
21 [comment="type=crddrop,outer=j,inner=val,mode=0" label="CrdDrop Compression j, val" color=orange style=filled type="crddrop" outer="j" inner="val" mode="0"]
22 [comment="type=crddrop,outer=i,inner=j" label="CrdDrop i,j" color=orange shape=box style=filled type="crddrop" outer="i" inner="j"]
17 -> 16 [label="crd" style=dashed type="crd" comment=""]
16 -> 15 [label="crd" style=dashed type="crd"]
15 -> 14 [label="repsig" style=dotted type="repsig"]
14 -> 13 [label="ref" style=bold type="ref"]
13 -> 12 [label="crd" style=dashed type="crd" comment=""]
12 -> 11 [label="crd" style=dashed type="crd"]
11 -> 10 [label="repsig" style=dotted type="repsig"]
10 -> 8 [label="ref" style=bold type="ref"]
8 -> 7 [label="crd_in-B" style=dashed type="crd" comment="in-B"]
7 -> 5 [label="ref_out-B" style=bold type="ref" comment="out-B"]
5 -> 4 [label="val" type="val"]
7 -> 6 [label="ref_out-C" style=bold type="ref" comment="out-C"]
6 -> 4 [label="val" type="val"]
8 -> 7 [label="ref_in-B" style=bold type="ref" comment="in-B"]
13 -> 9 [label="ref" style=bold type="ref" comment=""]
9 -> 7 [label="crd_in-C" style=dashed type="crd" comment="in-C"]
9 -> 7 [label="ref_in-C" style=bold type="ref" comment="in-C"]
17 -> 10 [label="ref" style=bold type="ref" comment=""]

4 -> 3 [label="val" type="val"]
12 -> 21 [label="crd_outer-j" style=dashed type="crd" comment="outer-j"]
3 -> 20 [label="val" type="val" comment="val"]
20 -> 21 [label="val" type="val" comment="inner-val"]
21 -> 22 [label="crd_inner-j" style=dashed type="crd" comment="outer-j"]

16 -> 22 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"]
21 -> 0 [label="val" type="val" comment="inner-val"]

22 -> 2 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"]
22 -> 1 [label="crd_inner-j" style=dashed type="crd" comment="inner-j"]
}
Loading

0 comments on commit 50f79ea

Please sign in to comment.