From b014c06a780dfafcbe2d984b7ed754753b505048 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Wed, 1 Nov 2023 11:33:07 -0700 Subject: [PATCH 1/6] added spmm kernel --- .../sam-outputs/onyx-dot/spmm_ijk_crddrop.gv | 55 +++++++++++++++++ .../sam-outputs/opal-dot/masked_broadcast.gv | 27 +++++++++ .../opal-dot/mat_elemadd_leakyrelu_exp.gv | 41 +++++++++++++ .../opal-dot/matmul_ijk_crddrop_relu.gv | 60 +++++++++++++++++++ .../sam-outputs/opal-dot/spmm_ijk_crddrop.gv | 55 +++++++++++++++++ .../opal-dot/trans_masked_broadcast.gv | 27 +++++++++ 6 files changed, 265 insertions(+) create mode 100644 compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop.gv create mode 100644 compiler/sam-outputs/opal-dot/masked_broadcast.gv create mode 100644 compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv create mode 100644 compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv create mode 100644 compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv create mode 100644 compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv diff --git a/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop.gv b/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop.gv new file mode 100644 index 00000000..4eaef89b --- /dev/null +++ b/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop.gv @@ -0,0 +1,55 @@ +digraph SAM { + comment="X=ss01,B=dd01,C=ss10" + 17 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=dense,src=true,root=true" label="FiberLookup i: B0\ndense" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="dense" 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=dense,src=true,root=false" label="FiberLookup k: B1\ndense" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B" mode="1" format="dense" 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=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"] + 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"] +} diff --git a/compiler/sam-outputs/opal-dot/masked_broadcast.gv b/compiler/sam-outputs/opal-dot/masked_broadcast.gv new file mode 100644 index 00000000..86b0bdba --- /dev/null +++ b/compiler/sam-outputs/opal-dot/masked_broadcast.gv @@ -0,0 +1,27 @@ +digraph SAM { + comment="X=ss01,B=ss01,c=s0" + 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] + 1 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"] + 2 [comment="type=repeat,index=i,tensor=c,root=true" label="Repeat i: B" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="c" root="true"] + 3 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=false" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="false"] + 4 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] + 5 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"] + 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] + 7 [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"] + 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] + 9 [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"] + 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] + 0 -> 10 [label="crd" style=dashed type="crd"] + 10 -> 1 [label="crd" style=dashed type="crd"] + 1 -> 2 [label="repsig" style=dotted type="repsig"] + 2 -> 3 [label="ref" style=bold type="ref"] + 0 -> 4 [label="ref" style=bold type="ref"] + 3 -> 5 [label="ref_in-c" style=bold type="ref" comment="in-c"] + 3 -> 5 [label="crd_in-c" style=dashed type="crd" comment="in-c"] + 4 -> 5 [label="ref_in-B", style=bold type="ref" comment="in-B"] + 4 -> 5 [label="crd_in-B", style=dashed type="crd" comment="in-B"] + 5 -> 6 [label="ref_out-c", style=bold type="ref" comment="out-c"] + 10 -> 7 [label="crd", style=dashed type="crd"] + 5 -> 8 [label="crd", style=dashed type="crd"] + 6 -> 9 [label="val", type="val"] +} diff --git a/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv b/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv new file mode 100644 index 00000000..e9a9f489 --- /dev/null +++ b/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv @@ -0,0 +1,41 @@ +digraph SAM { + comment="X=ss01,B=ss01,C=ss01" + 10 [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"] + 9 [comment="type=union,index=i" label="union i" color=purple shape=box style=filled type="union" index="i"] + 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"] + 7 [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"] + 6 [comment="type=union,index=j" label="union j" color=purple shape=box style=filled type="union" index="j"] + 1 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] + 4 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"] + 3 [comment="type=add,sub=0" label="Add" color=brown shape=box style=filled type="add" sub="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="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"] + 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=broadcast" shape=point style=invis type="broadcast"] + 13 [comment="type=mul,in2=0.2" label="Mul 0.2" color=brown shape=box style=filled type="mul" in2="0.2"] + 14 [comment="type=max" label="Max" color=brown shape=box style=filled type="max"] + 15 [comment="type=exp" label="Exp" color=brown shape=box style=filled type="exp"] + 10 -> 9 [label="crd_in-B" style=dashed type="crd" comment="in-B"] + 9 -> 2 [label="crd" style=dashed type="crd"] + 9 -> 7 [label="ref_out-B" style=bold type="ref" comment="out-B"] + 7 -> 6 [label="crd_in-B" style=dashed type="crd" comment="in-B"] + 6 -> 1 [label="crd" style=dashed type="crd"] + 6 -> 4 [label="ref_out-B" style=bold type="ref" comment="out-B"] + 4 -> 3 [label="val" type="val"] + 3 -> 12 [label="val" type="val"] + 12 -> 13 [label="val" type="val"] + 13 -> 14 [label="val" type="val"] + 12 -> 14 [label="val" type="val"] + 14 -> 15 [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"] + 9 -> 8 [label="ref_out-C" style=bold type="ref" comment="out-C"] + 8 -> 6 [label="crd_in-C" style=dashed type="crd" comment="in-C"] + 8 -> 6 [label="ref_in-C" style=bold type="ref" comment="in-C"] + 10 -> 9 [label="ref_in-B" style=bold type="ref" comment="in-B"] + 11 -> 9 [label="crd_in-C" style=dashed type="crd" comment="in-C"] + 11 -> 9 [label="ref_in-C" style=bold type="ref" comment="in-C"] +} diff --git a/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv b/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv new file mode 100644 index 00000000..5625ca41 --- /dev/null +++ b/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv @@ -0,0 +1,60 @@ +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=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"] + 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"] + 20 [comment="type=max" label="Max 0" color=brown shape=box style=filled type="max"] + 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 -> 19 [label="val_inner-k" type="val" comment="inner-k"] + 12 -> 19 [label="crd_outer-j" style=dashed type="crd" comment="outer-j"] + 19 -> 3 [label="val_inner-k" type="val" comment="inner-k"] + 3 -> 20 [label="val" type="val" comment="val"] + 20 -> 21 [label="val" type="val" comment="inner-val"] + 18 -> 21 [label="crd_inner-j" style=dashed type="crd" comment="outer-j"] + 21 -> 22 [label="crd_inner-j" style=dashed type="crd" comment="outer-j"] + 18 -> 22 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"] + + 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"] + 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"] +} diff --git a/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv b/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv new file mode 100644 index 00000000..4eaef89b --- /dev/null +++ b/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv @@ -0,0 +1,55 @@ +digraph SAM { + comment="X=ss01,B=dd01,C=ss10" + 17 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=dense,src=true,root=true" label="FiberLookup i: B0\ndense" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="dense" 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=dense,src=true,root=false" label="FiberLookup k: B1\ndense" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B" mode="1" format="dense" 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=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"] + 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"] +} diff --git a/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv b/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv new file mode 100644 index 00000000..06d63c95 --- /dev/null +++ b/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv @@ -0,0 +1,27 @@ +digraph SAM { + comment="X=ss01,B=ss01,c=s0" + 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] + 1 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="true"] + 2 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"] + 3 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] + 4 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"] + 5 [comment="type=repeat,index=j,tensor=c,root=false" label="Repeat j: B" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="c" root="false"] + 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] + 7 [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"] + 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] + 9 [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"] + 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] + 0 -> 2 [label="ref_in-B" style=bold type="ref" comment="in-B"] + 0 -> 2 [label="crd_in-B" style=dashed type="crd" comment="in-B"] + 1 -> 2 [label="ref_in-c" style=bold type="ref" comment="in-c"] + 1 -> 2 [label="crd_in-c" style=dashed type="crd" comment="in-c"] + 2 -> 3 [label="ref_out-B" style=bold type="ref" comment="out-B"] + 2 -> 7 [label="crd" style=dashed type="crd"] + 3 -> 10 [label="crd" style=dashed type="crd"] + 10 -> 4 [label="crd" style=dashed type="crd"] + 10 -> 8 [label="crd" style=dashed type="crd"] + 4 -> 5 [label="repsig" style=dotted type="repsig"] + 2 -> 5 [label="ref_out-c" style=bold type="ref" comment="out-c"] + 5 -> 6 [label="ref" style=bold type="ref"] + 6 -> 9 [label="val" type="val"] +} From 1cb638a04cdfe99c3fcbdd7acb5c50f592a30c1c Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Wed, 1 Nov 2023 11:33:38 -0700 Subject: [PATCH 2/6] remove unwanted benchmarks --- .../sam-outputs/opal-dot/masked_broadcast.gv | 27 --------- .../opal-dot/mat_elemadd_leakyrelu_exp.gv | 41 ------------- .../opal-dot/matmul_ijk_crddrop_relu.gv | 60 ------------------- .../sam-outputs/opal-dot/spmm_ijk_crddrop.gv | 55 ----------------- .../opal-dot/trans_masked_broadcast.gv | 27 --------- 5 files changed, 210 deletions(-) delete mode 100644 compiler/sam-outputs/opal-dot/masked_broadcast.gv delete mode 100644 compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv delete mode 100644 compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv delete mode 100644 compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv delete mode 100644 compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv diff --git a/compiler/sam-outputs/opal-dot/masked_broadcast.gv b/compiler/sam-outputs/opal-dot/masked_broadcast.gv deleted file mode 100644 index 86b0bdba..00000000 --- a/compiler/sam-outputs/opal-dot/masked_broadcast.gv +++ /dev/null @@ -1,27 +0,0 @@ -digraph SAM { - comment="X=ss01,B=ss01,c=s0" - 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] - 1 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"] - 2 [comment="type=repeat,index=i,tensor=c,root=true" label="Repeat i: B" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="c" root="true"] - 3 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=false" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="false"] - 4 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] - 5 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"] - 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] - 7 [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"] - 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] - 9 [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"] - 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] - 0 -> 10 [label="crd" style=dashed type="crd"] - 10 -> 1 [label="crd" style=dashed type="crd"] - 1 -> 2 [label="repsig" style=dotted type="repsig"] - 2 -> 3 [label="ref" style=bold type="ref"] - 0 -> 4 [label="ref" style=bold type="ref"] - 3 -> 5 [label="ref_in-c" style=bold type="ref" comment="in-c"] - 3 -> 5 [label="crd_in-c" style=dashed type="crd" comment="in-c"] - 4 -> 5 [label="ref_in-B", style=bold type="ref" comment="in-B"] - 4 -> 5 [label="crd_in-B", style=dashed type="crd" comment="in-B"] - 5 -> 6 [label="ref_out-c", style=bold type="ref" comment="out-c"] - 10 -> 7 [label="crd", style=dashed type="crd"] - 5 -> 8 [label="crd", style=dashed type="crd"] - 6 -> 9 [label="val", type="val"] -} diff --git a/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv b/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv deleted file mode 100644 index e9a9f489..00000000 --- a/compiler/sam-outputs/opal-dot/mat_elemadd_leakyrelu_exp.gv +++ /dev/null @@ -1,41 +0,0 @@ -digraph SAM { - comment="X=ss01,B=ss01,C=ss01" - 10 [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"] - 9 [comment="type=union,index=i" label="union i" color=purple shape=box style=filled type="union" index="i"] - 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"] - 7 [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"] - 6 [comment="type=union,index=j" label="union j" color=purple shape=box style=filled type="union" index="j"] - 1 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] - 4 [comment="type=arrayvals,tensor=B" label="Array Vals: B" color=green2 shape=box style=filled type="arrayvals" tensor="B"] - 3 [comment="type=add,sub=0" label="Add" color=brown shape=box style=filled type="add" sub="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="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"] - 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=broadcast" shape=point style=invis type="broadcast"] - 13 [comment="type=mul,in2=0.2" label="Mul 0.2" color=brown shape=box style=filled type="mul" in2="0.2"] - 14 [comment="type=max" label="Max" color=brown shape=box style=filled type="max"] - 15 [comment="type=exp" label="Exp" color=brown shape=box style=filled type="exp"] - 10 -> 9 [label="crd_in-B" style=dashed type="crd" comment="in-B"] - 9 -> 2 [label="crd" style=dashed type="crd"] - 9 -> 7 [label="ref_out-B" style=bold type="ref" comment="out-B"] - 7 -> 6 [label="crd_in-B" style=dashed type="crd" comment="in-B"] - 6 -> 1 [label="crd" style=dashed type="crd"] - 6 -> 4 [label="ref_out-B" style=bold type="ref" comment="out-B"] - 4 -> 3 [label="val" type="val"] - 3 -> 12 [label="val" type="val"] - 12 -> 13 [label="val" type="val"] - 13 -> 14 [label="val" type="val"] - 12 -> 14 [label="val" type="val"] - 14 -> 15 [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"] - 9 -> 8 [label="ref_out-C" style=bold type="ref" comment="out-C"] - 8 -> 6 [label="crd_in-C" style=dashed type="crd" comment="in-C"] - 8 -> 6 [label="ref_in-C" style=bold type="ref" comment="in-C"] - 10 -> 9 [label="ref_in-B" style=bold type="ref" comment="in-B"] - 11 -> 9 [label="crd_in-C" style=dashed type="crd" comment="in-C"] - 11 -> 9 [label="ref_in-C" style=bold type="ref" comment="in-C"] -} diff --git a/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv b/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv deleted file mode 100644 index 5625ca41..00000000 --- a/compiler/sam-outputs/opal-dot/matmul_ijk_crddrop_relu.gv +++ /dev/null @@ -1,60 +0,0 @@ -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=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"] - 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"] - 20 [comment="type=max" label="Max 0" color=brown shape=box style=filled type="max"] - 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 -> 19 [label="val_inner-k" type="val" comment="inner-k"] - 12 -> 19 [label="crd_outer-j" style=dashed type="crd" comment="outer-j"] - 19 -> 3 [label="val_inner-k" type="val" comment="inner-k"] - 3 -> 20 [label="val" type="val" comment="val"] - 20 -> 21 [label="val" type="val" comment="inner-val"] - 18 -> 21 [label="crd_inner-j" style=dashed type="crd" comment="outer-j"] - 21 -> 22 [label="crd_inner-j" style=dashed type="crd" comment="outer-j"] - 18 -> 22 [label="crd_outer-i" style=dashed type="crd" comment="outer-i"] - - 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"] - 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"] -} diff --git a/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv b/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv deleted file mode 100644 index 4eaef89b..00000000 --- a/compiler/sam-outputs/opal-dot/spmm_ijk_crddrop.gv +++ /dev/null @@ -1,55 +0,0 @@ -digraph SAM { - comment="X=ss01,B=dd01,C=ss10" - 17 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=dense,src=true,root=true" label="FiberLookup i: B0\ndense" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="dense" 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=dense,src=true,root=false" label="FiberLookup k: B1\ndense" color=green4 shape=box style=filled type="fiberlookup" index="k" tensor="B" mode="1" format="dense" 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=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"] - 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"] -} diff --git a/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv b/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv deleted file mode 100644 index 06d63c95..00000000 --- a/compiler/sam-outputs/opal-dot/trans_masked_broadcast.gv +++ /dev/null @@ -1,27 +0,0 @@ -digraph SAM { - comment="X=ss01,B=ss01,c=s0" - 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] - 1 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="true"] - 2 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"] - 3 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] - 4 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"] - 5 [comment="type=repeat,index=j,tensor=c,root=false" label="Repeat j: B" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="c" root="false"] - 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] - 7 [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"] - 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] - 9 [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"] - 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] - 0 -> 2 [label="ref_in-B" style=bold type="ref" comment="in-B"] - 0 -> 2 [label="crd_in-B" style=dashed type="crd" comment="in-B"] - 1 -> 2 [label="ref_in-c" style=bold type="ref" comment="in-c"] - 1 -> 2 [label="crd_in-c" style=dashed type="crd" comment="in-c"] - 2 -> 3 [label="ref_out-B" style=bold type="ref" comment="out-B"] - 2 -> 7 [label="crd" style=dashed type="crd"] - 3 -> 10 [label="crd" style=dashed type="crd"] - 10 -> 4 [label="crd" style=dashed type="crd"] - 10 -> 8 [label="crd" style=dashed type="crd"] - 4 -> 5 [label="repsig" style=dotted type="repsig"] - 2 -> 5 [label="ref_out-c" style=bold type="ref" comment="out-c"] - 5 -> 6 [label="ref" style=bold type="ref"] - 6 -> 9 [label="val" type="val"] -} From acd05d0bfa932d24577a1cf4b11973cab4594d86 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Thu, 2 Nov 2023 00:50:35 -0700 Subject: [PATCH 3/6] added masked_broadcast and trans_masked_broadcast --- .../sam-outputs/onyx-dot/masked_broadcast.gv | 27 +++++++++++++++++++ .../onyx-dot/trans_masked_broadcast.gv | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 compiler/sam-outputs/onyx-dot/masked_broadcast.gv create mode 100644 compiler/sam-outputs/onyx-dot/trans_masked_broadcast.gv diff --git a/compiler/sam-outputs/onyx-dot/masked_broadcast.gv b/compiler/sam-outputs/onyx-dot/masked_broadcast.gv new file mode 100644 index 00000000..86b0bdba --- /dev/null +++ b/compiler/sam-outputs/onyx-dot/masked_broadcast.gv @@ -0,0 +1,27 @@ +digraph SAM { + comment="X=ss01,B=ss01,c=s0" + 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] + 1 [comment="type=repsiggen,index=i" label="RepeatSignalGenerator i" color=cyan3 shape=box style=filled type="repsiggen" index="i"] + 2 [comment="type=repeat,index=i,tensor=c,root=true" label="Repeat i: B" color=cyan2 shape=box style=filled type="repeat" index="i" tensor="c" root="true"] + 3 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=false" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="false"] + 4 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] + 5 [comment="type=intersect,index=j" label="intersect j" color=purple shape=box style=filled type="intersect" index="j"] + 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] + 7 [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"] + 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] + 9 [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"] + 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] + 0 -> 10 [label="crd" style=dashed type="crd"] + 10 -> 1 [label="crd" style=dashed type="crd"] + 1 -> 2 [label="repsig" style=dotted type="repsig"] + 2 -> 3 [label="ref" style=bold type="ref"] + 0 -> 4 [label="ref" style=bold type="ref"] + 3 -> 5 [label="ref_in-c" style=bold type="ref" comment="in-c"] + 3 -> 5 [label="crd_in-c" style=dashed type="crd" comment="in-c"] + 4 -> 5 [label="ref_in-B", style=bold type="ref" comment="in-B"] + 4 -> 5 [label="crd_in-B", style=dashed type="crd" comment="in-B"] + 5 -> 6 [label="ref_out-c", style=bold type="ref" comment="out-c"] + 10 -> 7 [label="crd", style=dashed type="crd"] + 5 -> 8 [label="crd", style=dashed type="crd"] + 6 -> 9 [label="val", type="val"] +} diff --git a/compiler/sam-outputs/onyx-dot/trans_masked_broadcast.gv b/compiler/sam-outputs/onyx-dot/trans_masked_broadcast.gv new file mode 100644 index 00000000..06d63c95 --- /dev/null +++ b/compiler/sam-outputs/onyx-dot/trans_masked_broadcast.gv @@ -0,0 +1,27 @@ +digraph SAM { + comment="X=ss01,B=ss01,c=s0" + 0 [comment="type=fiberlookup,index=i,tensor=B,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="B" mode="0" format="compressed" src="true" root="true"] + 1 [comment="type=fiberlookup,index=i,tensor=c,mode=0,format=compressed,src=true,root=true" label="FiberLookup i: c\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="i" tensor="c" mode="0" format="compressed" src="true" root="true"] + 2 [comment="type=intersect,index=i" label="intersect i" color=purple shape=box style=filled type="intersect" index="i"] + 3 [comment="type=fiberlookup,index=j,tensor=B,mode=1,format=compressed,src=true,root=false" label="FiberLookup j: B\ncompressed" color=green4 shape=box style=filled type="fiberlookup" index="j" tensor="B" mode="1" format="compressed" src="true" root="false"] + 4 [comment="type=repsiggen,index=j" label="RepeatSignalGenerator j" color=cyan3 shape=box style=filled type="repsiggen" index="j"] + 5 [comment="type=repeat,index=j,tensor=c,root=false" label="Repeat j: B" color=cyan2 shape=box style=filled type="repeat" index="j" tensor="c" root="false"] + 6 [comment="type=arrayvals,tensor=c" label="Array Vals: c" color=green2 shape=box style=filled type="arrayvals" tensor="c"] + 7 [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"] + 8 [comment="type=fiberwrite,index=j,tensor=X,mode=1,format=compressed,segsize=B0_dim+1,crdsize=B0_dim*B1_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*B1_dim" sink="true"] + 9 [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"] + 10 [comment="type=broadcast" shape=point style=invis type="broadcast"] + 0 -> 2 [label="ref_in-B" style=bold type="ref" comment="in-B"] + 0 -> 2 [label="crd_in-B" style=dashed type="crd" comment="in-B"] + 1 -> 2 [label="ref_in-c" style=bold type="ref" comment="in-c"] + 1 -> 2 [label="crd_in-c" style=dashed type="crd" comment="in-c"] + 2 -> 3 [label="ref_out-B" style=bold type="ref" comment="out-B"] + 2 -> 7 [label="crd" style=dashed type="crd"] + 3 -> 10 [label="crd" style=dashed type="crd"] + 10 -> 4 [label="crd" style=dashed type="crd"] + 10 -> 8 [label="crd" style=dashed type="crd"] + 4 -> 5 [label="repsig" style=dotted type="repsig"] + 2 -> 5 [label="ref_out-c" style=bold type="ref" comment="out-c"] + 5 -> 6 [label="ref" style=bold type="ref"] + 6 -> 9 [label="val" type="val"] +} From ef31fa313bf1a45bc0b23741e5c6fbd38b89b7fc Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Wed, 15 Nov 2023 00:13:35 -0800 Subject: [PATCH 4/6] update configuration code for pe and reduce to account for the new config register heirarchy in reduce_pe_cluster. also modified the signal name for connection from crddrop to reduce and reduce to arrayval to match the new signal name of reduce in cluster, matmul_ijk_crddrop passed --- sam/onyx/hw_nodes/compute_node.py | 13 +++++++++++-- sam/onyx/hw_nodes/merge_node.py | 2 +- sam/onyx/hw_nodes/reduce_node.py | 18 +++++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/sam/onyx/hw_nodes/compute_node.py b/sam/onyx/hw_nodes/compute_node.py index 2fb7620f..f6c651a2 100644 --- a/sam/onyx/hw_nodes/compute_node.py +++ b/sam/onyx/hw_nodes/compute_node.py @@ -151,6 +151,12 @@ def configure(self, attributes): comment = attributes['comment'].strip('"') print(c_op) op_code = 0 + # configuring via sam, it is a sparse app + use_dense = False + # mapping to pe only, configuring only the pe, ignore the reduce + pe_only = True + # data I/O should interface with other primitive outside of the cluster + pe_in_external = True if c_op == 'mul': op_code = 1 elif c_op == 'add' and 'sub=1' not in comment: @@ -158,6 +164,9 @@ def configure(self, attributes): elif c_op == 'add' and 'sub=1' in comment: op_code = 2 cfg_kwargs = { - 'op': op_code + 'op': op_code, + 'use_dense': use_dense, + 'pe_only': pe_only, + 'pe_in_external': pe_in_external } - return op_code, cfg_kwargs + return (op_code, use_dense, pe_only, pe_in_external), cfg_kwargs diff --git a/sam/onyx/hw_nodes/merge_node.py b/sam/onyx/hw_nodes/merge_node.py index 9b1f1ae7..c0b3d158 100644 --- a/sam/onyx/hw_nodes/merge_node.py +++ b/sam/onyx/hw_nodes/merge_node.py @@ -68,7 +68,7 @@ def connect(self, other, edge, kwargs=None): other_red = other.get_name() new_conns = { f'merge_to_reduce_inner': [ - ([(merge, f"cmrg_coord_out_{0}"), (other_red, f"data_in")], 17), + ([(merge, f"cmrg_coord_out_{0}"), (other_red, f"reduce_data_in")], 17), ] } diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index 5caac658..4b2e679f 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -39,7 +39,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { 'reduce_to_wr_scan': [ # send output to rd scanner - ([(red, "data_out"), (wr_scan, "data_in")], 17), + ([(red, "reduce_data_out"), (wr_scan, "data_in")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -102,7 +102,19 @@ def connect(self, other, edge, kwargs=None): def configure(self, attributes): # TODO stop_lvl = 2 + # configuring via sam, it is a sparse app + use_dense = False + # configuring both the pe and the reduce + pe_only = False + # data I/O to and from the PE should be internal with the reduce + pe_in_external = False + # op is set to integer add for the PE TODO: make this configurable in the sam graph + op = 0 cfg_kwargs = { - 'stop_lvl': stop_lvl + 'stop_lvl': stop_lvl, + 'use_dense': use_dense, + 'pe_only': pe_only, + 'pe_in_external': pe_in_external, + 'op': op } - return stop_lvl, cfg_kwargs + return (stop_lvl, use_dense, pe_only, pe_in_external, op), cfg_kwargs From d0793dde6b547fd2d1a09a613960c4c0f5d0bc62 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Wed, 15 Nov 2023 10:28:06 -0800 Subject: [PATCH 5/6] update port name for connection from reduce to reduce, also updated the reduce node configuration to use dense mode --- sam/onyx/hw_nodes/compute_node.py | 4 ++-- sam/onyx/hw_nodes/reduce_node.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sam/onyx/hw_nodes/compute_node.py b/sam/onyx/hw_nodes/compute_node.py index f6c651a2..2482f399 100644 --- a/sam/onyx/hw_nodes/compute_node.py +++ b/sam/onyx/hw_nodes/compute_node.py @@ -81,7 +81,7 @@ def connect(self, other, edge, kwargs=None): pe = self.get_name() new_conns = { f'pe_to_reduce': [ - ([(pe, "res"), (other_red, f"data_in")], 17), + ([(pe, "res"), (other_red, f"reduce_data_in")], 17), ] } return new_conns @@ -156,7 +156,7 @@ def configure(self, attributes): # mapping to pe only, configuring only the pe, ignore the reduce pe_only = True # data I/O should interface with other primitive outside of the cluster - pe_in_external = True + pe_in_external = 1 if c_op == 'mul': op_code = 1 elif c_op == 'add' and 'sub=1' not in comment: diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index 4b2e679f..aa101d12 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -53,7 +53,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { 'reduce_to_reduce': [ # send output to rd scanner - ([(red, "data_out"), (other_red, "data_in")], 17), + ([(red, "reduce_data_out"), (other_red, "reduce_data_in")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -72,7 +72,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { f'reduce_to_pe_{other_conn}': [ # send output to rd scanner - ([(red, "data_out"), (pe, f"data{other_conn}")], 17), + ([(red, "reduce_data_out"), (pe, f"data{other_conn}")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -102,19 +102,19 @@ def connect(self, other, edge, kwargs=None): def configure(self, attributes): # TODO stop_lvl = 2 - # configuring via sam, it is a sparse app - use_dense = False - # configuring both the pe and the reduce + # bypassing the fifos in the pe, get result in a single cycle pe_only = False + # configuring both the pe and the reduce + pe_connected_to_reduce = True # data I/O to and from the PE should be internal with the reduce - pe_in_external = False + pe_in_external = 0 # op is set to integer add for the PE TODO: make this configurable in the sam graph op = 0 cfg_kwargs = { 'stop_lvl': stop_lvl, - 'use_dense': use_dense, + 'pe_connected_to_reduce': pe_connected_to_reduce, 'pe_only': pe_only, 'pe_in_external': pe_in_external, 'op': op } - return (stop_lvl, use_dense, pe_only, pe_in_external, op), cfg_kwargs + return (stop_lvl, pe_connected_to_reduce, pe_only, pe_in_external, op), cfg_kwargs From b39b2b429157e98bc58bcd9d1c62ac84af11d50a Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Wed, 15 Nov 2023 14:24:29 -0800 Subject: [PATCH 6/6] fix code style --- sam/onyx/hw_nodes/reduce_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index aa101d12..6ed41cf7 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -108,7 +108,7 @@ def configure(self, attributes): pe_connected_to_reduce = True # data I/O to and from the PE should be internal with the reduce pe_in_external = 0 - # op is set to integer add for the PE TODO: make this configurable in the sam graph + # op is set to integer add for the PE TODO: make this configurable in the sam graph op = 0 cfg_kwargs = { 'stop_lvl': stop_lvl,