Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions test.dfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{"outputs": [],
"inputs": [0, 1, 2, 3],
"atoms":
[{"async":
{"outputs": [6],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [4, 5]}},
{"async":
{"outputs": [9],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [7, 8]}},
{"async":
{"outputs": [4, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"op": {"fork": {"n": 15}},
"inputs": [10]}},
{"async": {"outputs": [26, 27], "op": {"fork": {"n": 2}}, "inputs": [25]}},
{"async":
{"outputs": [28],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [23, 26]}},
{"async":
{"outputs": [29],
"op": {"steer": {"n": 1, "flavor": false}},
"inputs": [24, 27]}},
{"async":
{"outputs": [33],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [30, 31, 32]}},
{"async":
{"outputs": [7, 35, 36, 37, 38, 39, 30, 40, 41],
"op": {"fork": {"n": 9}},
"inputs": [34]}},
{"async": {"outputs": [43, 44], "op": {"fork": {"n": 2}}, "inputs": [42]}},
{"async":
{"outputs": [45],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [21, 43]}},
{"async":
{"outputs": [46],
"op": {"steer": {"n": 1, "flavor": false}},
"inputs": [22, 44]}},
{"async":
{"outputs": [48], "op": {"const": {"n": 1, "c": 0}}, "inputs": [47]}},
{"async":
{"outputs": [50], "op": {"const": {"n": 1, "c": 0}}, "inputs": [49]}},
{"async":
{"outputs": [52], "op": {"const": {"n": 1, "c": 0}}, "inputs": [51]}},
{"async": {"outputs": [54, 55], "op": {"fork": {"n": 2}}, "inputs": [53]}},
{"async":
{"outputs": [57, 58, 59], "op": {"fork": {"n": 3}}, "inputs": [56]}},
{"async":
{"outputs": [56],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [36, 55]}},
{"async":
{"outputs": [60],
"op": {"inv": {"flavor": true, "c": null}},
"inputs": [38, 0]}},
{"async": {"outputs": [62, 63], "op": {"fork": {"n": 2}}, "inputs": [61]}},
{"async":
{"outputs": [65, 66, 67], "op": {"fork": {"n": 3}}, "inputs": [64]}},
{"async":
{"outputs": [64],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [11, 63]}},
{"async": {"outputs": [69, 70], "op": {"fork": {"n": 2}}, "inputs": [68]}},
{"async": {"outputs": [72, 73], "op": {"fork": {"n": 2}}, "inputs": [71]}},
{"async":
{"outputs": [74],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [19, 72]}},
{"async":
{"outputs": [75],
"op": {"steer": {"n": 1, "flavor": false}},
"inputs": [20, 73]}},
{"async":
{"outputs": [77], "op": {"const": {"n": 1, "c": 1}}, "inputs": [76]}},
{"async":
{"outputs": [79], "op": {"const": {"n": 1, "c": 1}}, "inputs": [78]}},
{"async":
{"outputs": [80],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [41, 33]}},
{"async":
{"outputs": [47, 49, 81, 82, 78, 32],
"op": {"fork": {"n": 6}},
"inputs": [80]}},
{"async":
{"outputs": [85], "op": {"order": {"n": 4}}, "inputs": [83, 75, 29, 84]}},
{"op": {"outputs": [84], "op": {"store": "y"}, "inputs": [59, 86]}},
{"async":
{"outputs": [87, 88, 76, 89], "op": {"fork": {"n": 4}}, "inputs": [74]}},
{"async":
{"outputs": [92], "op": {"order": {"n": 3}}, "inputs": [28, 90, 91]}},
{"op": {"outputs": [95], "op": "mul", "inputs": [93, 94]}},
{"op": {"outputs": [97], "op": "add", "inputs": [96, 65]}},
{"op": {"outputs": [96], "op": "mul", "inputs": [98, 99]}},
{"async":
{"outputs": [101],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [35, 100]}},
{"async": {"outputs": [51, 31], "op": {"fork": {"n": 2}}, "inputs": [2]}},
{"async":
{"outputs": [100],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [40, 3, 85]}},
{"async":
{"outputs": [8],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [39, 1, 102]}},
{"async": {"outputs": [103, 83], "op": {"fork": {"n": 2}}, "inputs": [101]}},
{"async": {"outputs": [104, 102], "op": {"fork": {"n": 2}}, "inputs": [9]}},
{"async":
{"outputs": [105],
"op": {"steer": {"n": 1, "flavor": true}},
"inputs": [12, 70]}},
{"async": {"outputs": [99, 106], "op": {"fork": {"n": 2}}, "inputs": [105]}},
{"op": {"outputs": [107], "op": "add", "inputs": [45, 95]}},
{"async": {"outputs": [98, 108], "op": {"fork": {"n": 2}}, "inputs": [6]}},
{"op": {"outputs": [109], "op": "add", "inputs": [66, 77]}},
{"op": {"outputs": [110], "op": "add", "inputs": [58, 79]}},
{"async":
{"outputs": [61],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [13, 48, 109]}},
{"async":
{"outputs": [5],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [14, 57, 108]}},
{"async":
{"outputs": [42],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [15, 50, 107]}},
{"async":
{"outputs": [68],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [16, 104, 106]}},
{"async":
{"outputs": [71],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [17, 81, 89]}},
{"async":
{"outputs": [25],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [18, 103, 92]}},
{"async":
{"outputs": [53],
"op": {"merge": {"state": "popLeft", "n": 1}},
"inputs": [37, 52, 110]}},
{"op": {"outputs": [34], "op": "lt", "inputs": [54, 60]}},
{"op": {"outputs": [10], "op": "lt", "inputs": [62, 69]}},
{"async": {"outputs": [111], "op": {"order": {"n": 2}}, "inputs": [97, 87]}},
{"async": {"outputs": [93, 90], "op": {"fork": {"n": 2}}, "inputs": [112]}},
{"op": {"outputs": [112], "op": {"load": "a"}, "inputs": [111]}},
{"async": {"outputs": [113], "op": {"order": {"n": 2}}, "inputs": [67, 88]}},
{"async": {"outputs": [94, 91], "op": {"fork": {"n": 2}}, "inputs": [114]}},
{"op": {"outputs": [114], "op": {"load": "x"}, "inputs": [113]}},
{"async": {"outputs": [86], "op": {"order": {"n": 2}}, "inputs": [46, 82]}}]}
84 changes: 84 additions & 0 deletions tests/log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
=========== ../dfx/examples/output/copy_array.json
[trace] compiled 1 function(s). graph size: 26 ops
[trace] erased ghost tokens. graph size: 43 ops
[trace] applying op selection and optimizations...
[trace] 152 rewrites. graph size: 20 ops
[trace] non-trivial operators: 11
.lake/build/bin/wavelet $name > /dev/null 0.06s user 0.01s system 93% cpu 0.072 total
=========== ../dfx/examples/output/diffusion.json
[trace] compiled 2 function(s). graph size: 52 ops
[trace] erased ghost tokens. graph size: 89 ops
[trace] applying op selection and optimizations...
[trace] 262 rewrites. graph size: 49 ops
[trace] non-trivial operators: 29
.lake/build/bin/wavelet $name > /dev/null 0.22s user 0.01s system 97% cpu 0.231 total
=========== ../dfx/examples/output/dmv.json
[trace] compiled 3 function(s). graph size: 75 ops
[trace] erased ghost tokens. graph size: 121 ops
[trace] applying op selection and optimizations...
[trace] 451 rewrites. graph size: 71 ops
[trace] non-trivial operators: 43
.lake/build/bin/wavelet $name > /dev/null 0.87s user 0.01s system 99% cpu 0.887 total
=========== ../dfx/examples/output/increment.json
[trace] compiled 1 function(s). graph size: 28 ops
[trace] erased ghost tokens. graph size: 47 ops
[trace] applying op selection and optimizations...
[trace] 149 rewrites. graph size: 26 ops
[trace] non-trivial operators: 14
.lake/build/bin/wavelet $name > /dev/null 0.07s user 0.01s system 98% cpu 0.078 total
=========== ../dfx/examples/output/nn_fc.json
[trace] compiled 4 function(s). graph size: 109 ops
[trace] erased ghost tokens. graph size: 171 ops
[trace] applying op selection and optimizations...
[trace] 703 rewrites. graph size: 109 ops
[trace] non-trivial operators: 68
.lake/build/bin/wavelet $name > /dev/null 2.91s user 0.01s system 99% cpu 2.949 total
=========== ../dfx/examples/output/nn_relu.json
[trace] compiled 2 function(s). graph size: 53 ops
[trace] erased ghost tokens. graph size: 85 ops
[trace] applying op selection and optimizations...
[trace] 315 rewrites. graph size: 60 ops
[trace] non-trivial operators: 39
.lake/build/bin/wavelet $name > /dev/null 0.34s user 0.01s system 95% cpu 0.365 total
=========== ../dfx/examples/output/prefix_sum.json
[trace] compiled 2 function(s). graph size: 46 ops
[trace] erased ghost tokens. graph size: 76 ops
[trace] applying op selection and optimizations...
[trace] 249 rewrites. graph size: 43 ops
[trace] non-trivial operators: 26
.lake/build/bin/wavelet $name > /dev/null 0.19s user 0.00s system 96% cpu 0.200 total
=========== ../dfx/examples/output/raw.json
[trace] compiled 1 function(s). graph size: 30 ops
[trace] erased ghost tokens. graph size: 51 ops
[trace] applying op selection and optimizations...
[trace] 176 rewrites. graph size: 26 ops
[trace] non-trivial operators: 16
.lake/build/bin/wavelet $name > /dev/null 0.09s user 0.01s system 97% cpu 0.098 total
=========== ../dfx/examples/output/sum.json
[trace] compiled 1 function(s). graph size: 23 ops
[trace] erased ghost tokens. graph size: 36 ops
[trace] applying op selection and optimizations...
[trace] 141 rewrites. graph size: 20 ops
[trace] non-trivial operators: 13
.lake/build/bin/wavelet $name > /dev/null 0.06s user 0.00s system 91% cpu 0.071 total
=========== ../dfx/examples/output/war.json
[trace] compiled 1 function(s). graph size: 29 ops
[trace] erased ghost tokens. graph size: 49 ops
[trace] applying op selection and optimizations...
[trace] 163 rewrites. graph size: 29 ops
[trace] non-trivial operators: 16
.lake/build/bin/wavelet $name > /dev/null 0.08s user 0.01s system 93% cpu 0.089 total
=========== ../dfx/examples/output/waw.json
[trace] compiled 1 function(s). graph size: 31 ops
[trace] erased ghost tokens. graph size: 53 ops
[trace] applying op selection and optimizations...
[trace] 182 rewrites. graph size: 26 ops
[trace] non-trivial operators: 15
.lake/build/bin/wavelet $name > /dev/null 0.09s user 0.00s system 94% cpu 0.097 total
=========== ../dfx/examples/output/zero_out.json
[trace] compiled 1 function(s). graph size: 26 ops
[trace] erased ghost tokens. graph size: 42 ops
[trace] applying op selection and optimizations...
[trace] 148 rewrites. graph size: 19 ops
[trace] non-trivial operators: 9
.lake/build/bin/wavelet $name > /dev/null 0.06s user 0.00s system 92% cpu 0.068 total
43 changes: 43 additions & 0 deletions tests/tests-dmm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[
{
"inputs": [1, 1, 1, 0, 0],
"state": [
{
"loc": "a",
"values": [[0, 3]]
},
{
"loc": "b",
"values": [[0, 2]]
},
{
"loc": "z",
"values": [[0, 0]]
}
]
},
{
"inputs": [2, 3, 3, 0, 0],
"state": [
{
"loc": "a",
"values": [
[0, 1], [1, 2], [2, 3],
[3, 4], [4, 5], [5, 6]
]
},
{
"loc": "b",
"values": [
[0, 2], [1, 0], [2, 0],
[3, 0], [4, 2], [5, 0],
[6, 0], [7, 0], [8, 2]
]
},
{
"loc": "z",
"values": []
}
]
}
]
45 changes: 45 additions & 0 deletions tests/tests-dmv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[
{
"inputs": [1, 1, 0, 0],
"state": [
{
"loc": "a",
"values": [[0, 3]]
},
{
"loc": "x",
"values": [[0, 2]]
},
{
"loc": "y",
"values": [[0, 0]]
}
]
},
{
"inputs": [2, 3, 0, 0],
"state": [
{
"loc": "a",
"values": [
[0, 1], [1, 2], [2, 3],
[3, 4], [4, 5], [5, 6]
]
},
{
"loc": "x",
"values": [
[0, 1],
[1, 2],
[2, 3]
]
},
{
"loc": "y",
"values": [
[0, 0], [1, 0]
]
}
]
}
]
45 changes: 45 additions & 0 deletions tests/tests-nn-fc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[
{
"inputs": [0, 1, 1, 0, 0],
"state": [
{
"loc": "weight",
"values": [[0, 3]]
},
{
"loc": "src",
"values": [[0, 2]]
},
{
"loc": "dest",
"values": [[0, -100]]
}
]
},
{
"inputs": [1, 2, 3, 0, 0],
"state": [
{
"loc": "weight",
"values": [
[0, 1], [1, 2], [2, 3],
[3, 4], [4, 5], [5, 6]
]
},
{
"loc": "src",
"values": [
[0, 1],
[1, 2],
[2, 3]
]
},
{
"loc": "dest",
"values": [
[0, 0], [1, 0]
]
}
]
}
]
16 changes: 16 additions & 0 deletions tests/tests-sum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"inputs": [0, 1000, 4, 0, 0],
"state": [
{
"loc": "A",
"values": [
[0, 10],
[1, 20],
[2, 30],
[3, 40]
]
}
]
}
]
Loading
Loading