From 8d535b9840d0298876d626446513938ecd73fb89 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Thu, 11 Jan 2024 11:16:33 -0800 Subject: [PATCH 1/2] updated the graph of spmm_ijk_crdddrop_relu to avoid deadlock in the crddrop-compression-crddrop loop --- .../sam-outputs/onyx-dot/spmm_ijk_crddrop_relu.gv | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop_relu.gv b/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop_relu.gv index 65e5e1ad..7fdda848 100644 --- a/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop_relu.gv +++ b/compiler/sam-outputs/onyx-dot/spmm_ijk_crddrop_relu.gv @@ -18,8 +18,6 @@ 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"] - 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"] @@ -42,17 +40,13 @@ digraph SAM { 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"] + 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"] - 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"] + 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"] From 2e58788296fdd0b64dc51ae12cd15f18e2412286 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Thu, 11 Jan 2024 11:35:50 -0800 Subject: [PATCH 2/2] fixes potential primitve deadlock in the graph of matmul_ijk_crddrop_relu --- .../sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv b/compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv index 5625ca41..107d4d2c 100644 --- a/compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv +++ b/compiler/sam-outputs/onyx-dot/matmul_ijk_crddrop_relu.gv @@ -18,8 +18,6 @@ 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"] - 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"] @@ -42,17 +40,13 @@ digraph SAM { 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"] + 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"] - 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"] + 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"]