Merged
feat(IR): Check or render the func builder #5746
Jie YinAdd on Aug 27
feat(IR): Check or render the func builder #5746
Merged
Merged fromyinjie27_/pyptoir-compile-assertintocann/pyptomaster
Total: 71 files changed+568-454
| @@ -52,7 +52,7 @@ def test_attr_move(): | |||
| 52 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 52 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 53 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 53 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 54 | func = pil.compile(foo, x, y) | 54 | func = pil.compile(foo, x, y) |
| 55 | - check_snapshot(func, IR1.read_text()) | 55 | + check_snapshot(func, IR1) |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | @dataclass | 58 | @dataclass |
| @@ -75,7 +75,7 @@ def test_attr_move_pair(): | |||
| 75 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 75 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 76 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 76 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 77 | func = pil.compile(foo, x, y) | 77 | func = pil.compile(foo, x, y) |
| 78 | - check_snapshot(func, IR2.read_text()) | 78 | + check_snapshot(func, IR2) |
| 79 | 79 | ||
| 80 | 80 | ||
| 81 | def test_attr_assign(): | 81 | def test_attr_assign(): |
| @@ -90,7 +90,7 @@ def test_attr_assign(): | |||
| 90 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 90 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 91 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 91 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 92 | func = pil.compile(foo, x, y) | 92 | func = pil.compile(foo, x, y) |
| 93 | - check_snapshot(func, IR3.read_text()) | 93 | + check_snapshot(func, IR3) |
| 94 | 94 | ||
| 95 | 95 | ||
| 96 | @dataclass | 96 | @dataclass |
| @@ -113,7 +113,7 @@ def test_attr_move_multi_level(): | |||
| 113 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 113 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 114 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 114 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 115 | func = pil.compile(foo, x, y) | 115 | func = pil.compile(foo, x, y) |
| 116 | - check_snapshot(func, IR4.read_text()) | 116 | + check_snapshot(func, IR4) |
| 117 | 117 | ||
| 118 | 118 | ||
| 119 | @dataclass | 119 | @dataclass |
| @@ -143,7 +143,7 @@ def test_cross_func_attr_carry(): | |||
| 143 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 143 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 144 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 144 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 145 | func = pil.compile(foo, x, y) | 145 | func = pil.compile(foo, x, y) |
| 146 | - check_snapshot(func, IR5.read_text()) | 146 | + check_snapshot(func, IR5) |
| 147 | 147 | ||
| 148 | 148 | ||
| 149 | def test_cross_func_dotted_arg_carry(): | 149 | def test_cross_func_dotted_arg_carry(): |
| @@ -163,7 +163,7 @@ def test_cross_func_dotted_arg_carry(): | |||
| 163 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 163 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 164 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 164 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 165 | func = pil.compile(foo, x, y) | 165 | func = pil.compile(foo, x, y) |
| 166 | - check_snapshot(func, IR6.read_text()) | 166 | + check_snapshot(func, IR6) |
| 167 | 167 | ||
| 168 | 168 | ||
| 169 | def test_cross_func_move_carry(): | 169 | def test_cross_func_move_carry(): |
| @@ -183,4 +183,4 @@ def test_cross_func_move_carry(): | |||
| 183 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') | 183 | x = pypto.Tensor((32, 32), pypto.DT_FP32, 'x') |
| 184 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') | 184 | y = pypto.Tensor((32, 32), pypto.DT_FP32, 'y') |
| 185 | func = pil.compile(foo, x, y) | 185 | func = pil.compile(foo, x, y) |
| 186 | - check_snapshot(func, IR7.read_text()) | 186 | + check_snapshot(func, IR7) |
| @@ -10,12 +10,22 @@ | |||
| 10 | 10 | ||
| 11 | import difflib | 11 | import difflib |
| 12 | import logging | 12 | import logging |
| 13 | +import os | ||
| 14 | +from pathlib import Path | ||
| 15 | +from typing import Any | ||
| 13 | 16 | ||
| 14 | from pypto import ir, pil | 17 | from pypto import ir, pil |
| 15 | 18 | ||
| 16 | 19 | ||
| 17 | -def check_snapshot(func, golden): | 20 | +def check_snapshot(func: Any, golden_path: Path) -> None: |
| 21 | + if os.environ.get("PYPTO_RENDER_IR"): | ||
| 22 | + golden_path.parent.mkdir(parents=True, exist_ok=True) | ||
| 23 | + golden_path.write_text(str(func).strip() + "\n") | ||
| 24 | + print(f"Updated: {golden_path}") | ||
| 25 | + return | ||
| 26 | + | ||
| 18 | actual = str(func) | 27 | actual = str(func) |
| 28 | + golden = golden_path.read_text() | ||
| 19 | if golden.strip() != actual.strip(): | 29 | if golden.strip() != actual.strip(): |
| 20 | diff = "".join( | 30 | diff = "".join( |
| 21 | difflib.unified_diff( | 31 | difflib.unified_diff( |
| @@ -9,9 +9,16 @@ | |||
| 9 | Tests targeting RootFunctionBuilder (ir_func_builder.cpp) coverage gaps. | 9 | Tests targeting RootFunctionBuilder (ir_func_builder.cpp) coverage gaps. |
| 10 | """ | 10 | """ |
| 11 | 11 | ||
| 12 | +import os | ||
| 13 | +from pathlib import Path | ||
| 14 | + | ||
| 12 | import pypto | 15 | import pypto |
| 13 | from pypto import ir, pil | 16 | from pypto import ir, pil |
| 14 | 17 | ||
| 18 | +from .test_common import check_snapshot | ||
| 19 | + | ||
| 20 | +_GOLDEN_DIR = Path(__file__).parent / "test_ir_func_builder_data" | ||
| 21 | + | ||
| 15 | 22 | ||
| 16 | def _collect_stmts(stmt, cls): | 23 | def _collect_stmts(stmt, cls): |
| 17 | result = [] | 24 | result = [] |
| @@ -31,7 +38,7 @@ def _collect_stmts(stmt, cls): | |||
| 31 | return result | 38 | return result |
| 32 | 39 | ||
| 33 | 40 | ||
| 34 | -def _run_root_only(func, *args): | 41 | +def _run_root_only(golden_name, func, *args): |
| 35 | """Run canonicalize + dce + create_root_functions (skip finalize). | 42 | """Run canonicalize + dce + create_root_functions (skip finalize). |
| 36 | 43 | ||
| 37 | Returns (program, dyn_func) so the caller can inspect the IR | 44 | Returns (program, dyn_func) so the caller can inspect the IR |
| @@ -40,6 +47,13 @@ def _run_root_only(func, *args): | |||
| 40 | b = ir.IRBuilder() | 47 | b = ir.IRBuilder() |
| 41 | compiled = pil.compile(func, *args) | 48 | compiled = pil.compile(func, *args) |
| 42 | prog = b.create_program([compiled], "main", ir.Span.unknown()) | 49 | prog = b.create_program([compiled], "main", ir.Span.unknown()) |
| 50 | + golden_path = _GOLDEN_DIR / f"{golden_name}.pypto" | ||
| 51 | + if os.environ.get("PYPTO_RENDER_IR"): | ||
| 52 | + _GOLDEN_DIR.mkdir(parents=True, exist_ok=True) | ||
| 53 | + golden_path.write_text(str(prog).strip() + "\n") | ||
| 54 | + print(f"Updated: {golden_path}") | ||
| 55 | + else: | ||
| 56 | + check_snapshot(prog, golden_path) | ||
| 43 | prog = ir.Pass.canonicalize()(prog) | 57 | prog = ir.Pass.canonicalize()(prog) |
| 44 | prog = ir.Pass.aggressive_dce()(prog) | 58 | prog = ir.Pass.aggressive_dce()(prog) |
| 45 | prog = ir.Pass.create_root_functions()(prog) | 59 | prog = ir.Pass.create_root_functions()(prog) |
| @@ -88,7 +102,7 @@ def test_incast_outcast_correctness(): | |||
| 88 | a = pypto.Tensor([32, 16], pypto.DT_FP32, name="a") | 102 | a = pypto.Tensor([32, 16], pypto.DT_FP32, name="a") |
| 89 | b = pypto.Tensor([32, 16], pypto.DT_FP32, name="b") | 103 | b = pypto.Tensor([32, 16], pypto.DT_FP32, name="b") |
| 90 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") | 104 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") |
| 91 | - prog, dyn_func = _run_root_only(foo, a, b, c) | 105 | + prog, dyn_func = _run_root_only("test_incast_outcast_correctness", foo, a, b, c) |
| 92 | 106 | ||
| 93 | _assert_func_counts(prog, 1) | 107 | _assert_func_counts(prog, 1) |
| 94 | 108 | ||
| @@ -113,7 +127,7 @@ def test_multiple_path_funcs(): | |||
| 113 | a = pypto.Tensor([32, 16], pypto.DT_FP32, name="a") | 127 | a = pypto.Tensor([32, 16], pypto.DT_FP32, name="a") |
| 114 | b = pypto.Tensor([32, 16], pypto.DT_FP32, name="b") | 128 | b = pypto.Tensor([32, 16], pypto.DT_FP32, name="b") |
| 115 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") | 129 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") |
| 116 | - prog, _ = _run_root_only(foo, a, b, c) | 130 | + prog, _ = _run_root_only("test_multiple_path_funcs", foo, a, b, c) |
| 117 | 131 | ||
| 118 | _assert_func_counts(prog, 2) | 132 | _assert_func_counts(prog, 2) |
| 119 | 133 | ||
| @@ -136,7 +150,7 @@ def test_if_without_else(): | |||
| 136 | 150 | ||
| 137 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") | 151 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") |
| 138 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") | 152 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") |
| 139 | - prog, _ = _run_root_only(foo, x, out) | 153 | + prog, _ = _run_root_only("test_if_without_else", foo, x, out) |
| 140 | 154 | ||
| 141 | _assert_func_counts(prog, 3) | 155 | _assert_func_counts(prog, 3) |
| 142 | 156 | ||
| @@ -159,7 +173,7 @@ def test_intermediate_tensor_cross_path_func(): | |||
| 159 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") | 173 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") |
| 160 | b = pypto.Tensor([16, 16], pypto.DT_FP32, name="b") | 174 | b = pypto.Tensor([16, 16], pypto.DT_FP32, name="b") |
| 161 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") | 175 | c = pypto.Tensor([32, 16], pypto.DT_FP32, name="c") |
| 162 | - prog, _ = _run_root_only(foo, a, b, c) | 176 | + prog, _ = _run_root_only("test_intermediate_tensor_cross_path_func", foo, a, b, c) |
| 163 | 177 | ||
| 164 | _assert_func_counts(prog, 2) | 178 | _assert_func_counts(prog, 2) |
| 165 | 179 | ||
| @@ -180,7 +194,7 @@ def test_multi_level_nested_loop(): | |||
| 180 | 194 | ||
| 181 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") | 195 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") |
| 182 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") | 196 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") |
| 183 | - prog, dyn_func = _run_root_only(foo, x, out) | 197 | + prog, dyn_func = _run_root_only("test_multi_level_nested_loop", foo, x, out) |
| 184 | 198 | ||
| 185 | _assert_func_counts(prog, 1) | 199 | _assert_func_counts(prog, 1) |
| 186 | 200 | ||
| @@ -204,7 +218,7 @@ def test_func_param_as_assemble_dst(): | |||
| 204 | 218 | ||
| 205 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") | 219 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") |
| 206 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") | 220 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") |
| 207 | - prog, _ = _run_root_only(foo, x, out) | 221 | + prog, _ = _run_root_only("test_func_param_as_assemble_dst", foo, x, out) |
| 208 | 222 | ||
| 209 | _assert_func_counts(prog, 1) | 223 | _assert_func_counts(prog, 1) |
| 210 | 224 | ||
| @@ -229,7 +243,7 @@ def test_two_segments_separated_by_if(): | |||
| 229 | 243 | ||
| 230 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") | 244 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") |
| 231 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") | 245 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") |
| 232 | - prog, dyn_func = _run_root_only(foo, x, out) | 246 | + prog, dyn_func = _run_root_only("test_two_segments_separated_by_if", foo, x, out) |
| 233 | 247 | ||
| 234 | _assert_func_counts(prog, 3) | 248 | _assert_func_counts(prog, 3) |
| 235 | 249 | ||
| @@ -258,7 +272,7 @@ def test_assemble_dedup_and_param_exclude(): | |||
| 258 | 272 | ||
| 259 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") | 273 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") |
| 260 | out = pypto.Tensor([16, 16], pypto.DT_FP32, name="out") | 274 | out = pypto.Tensor([16, 16], pypto.DT_FP32, name="out") |
| 261 | - prog, _ = _run_root_only(foo, a, out) | 275 | + prog, _ = _run_root_only("test_assemble_dedup_and_param_exclude", foo, a, out) |
| 262 | 276 | ||
| 263 | _assert_func_counts(prog, 2) | 277 | _assert_func_counts(prog, 2) |
| 264 | 278 | ||
| @@ -280,7 +294,7 @@ def test_sequential_loops(): | |||
| 280 | 294 | ||
| 281 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") | 295 | x = pypto.Tensor([64, 16], pypto.DT_FP32, name="x") |
| 282 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") | 296 | out = pypto.Tensor([64, 16], pypto.DT_FP32, name="out") |
| 283 | - prog, _ = _run_root_only(foo, x, out) | 297 | + prog, _ = _run_root_only("test_sequential_loops", foo, x, out) |
| 284 | 298 | ||
| 285 | _assert_func_counts(prog, 2) | 299 | _assert_func_counts(prog, 2) |
| 286 | 300 | ||
| @@ -294,7 +308,7 @@ def test_pure_tensor_op_single_path_func(): | |||
| 294 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") | 308 | a = pypto.Tensor([16, 16], pypto.DT_FP32, name="a") |
| 295 | b = pypto.Tensor([16, 16], pypto.DT_FP32, name="b") | 309 | b = pypto.Tensor([16, 16], pypto.DT_FP32, name="b") |
| 296 | out = pypto.Tensor([16, 16], pypto.DT_FP32, name="out") | 310 | out = pypto.Tensor([16, 16], pypto.DT_FP32, name="out") |
| 297 | - prog, _ = _run_root_only(foo, a, b, out) | 311 | + prog, _ = _run_root_only("test_pure_tensor_op_single_path_func", foo, a, b, out) |
| 298 | 312 | ||
| 299 | _assert_func_counts(prog, 1) | 313 | _assert_func_counts(prog, 1) |
| 300 | 314 | ||
| @@ -320,7 +334,7 @@ def test_if_else_both_branches(): | |||
| 320 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") | 334 | x = pypto.Tensor([32, 16], pypto.DT_FP32, name="x") |
| 321 | y = pypto.Tensor([32, 16], pypto.DT_FP32, name="y") | 335 | y = pypto.Tensor([32, 16], pypto.DT_FP32, name="y") |
| 322 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") | 336 | out = pypto.Tensor([32, 16], pypto.DT_FP32, name="out") |
| 323 | - prog, dyn_func = _run_root_only(foo, x, y, out) | 337 | + prog, dyn_func = _run_root_only("test_if_else_both_branches", foo, x, y, out) |
| 324 | 338 | ||
| 325 | _assert_func_counts(prog, 4) | 339 | _assert_func_counts(prog, 4) |
| 326 | 340 | ||
| @@ -0,0 +1,14 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %aux@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = TENSOR_ALLOC() token(); | ||
| 4 | + v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10000 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10001 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %aux@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10002 ASSEMBLE(%a@0) token() #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %av_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), int64_t %i_0 = for %loop_idx_44 inrange 0, 2, 1 iter { none %av = %None; none %i = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 8 | + v0_logical_tensor %View_aux@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10003 VIEW(%aux@2) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 9 | + v0_logical_tensor %out@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10004 ASSEMBLE(%View_aux@4) token() #toOffset(Unsupported); | ||
| 10 | + continue %View_aux@4, %loop_idx_44; | ||
| 11 | + } | ||
| 12 | + return %a@0, %out@1; | ||
| 13 | + } | ||
| 14 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + int64_t %i_0, v0_logical_tensor %xv_0@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 2, 1 iter { none %i = %None; none %xv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_x@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %out@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10001 ASSEMBLE(%View_x@2) token() #toOffset(Unsupported); | ||
| 6 | + continue %loop_idx_10, %View_x@2; | ||
| 7 | + } | ||
| 8 | + return %x@0, %out@1; | ||
| 9 | + } | ||
| 10 | +} | ||
| @@ -0,0 +1,18 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %y@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + int64_t %i_0, v0_logical_tensor %tmp_1@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), v0_logical_tensor %xv_0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), v0_logical_tensor %yv_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 2, 1 iter { none %i = %None; none %tmp = %None; none %xv = %None; none %yv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_x@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %View_y@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10001 VIEW(%y@1) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 6 | + v0_logical_tensor %tmp_0@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = if v0eq(loop_idx_10, 0) then { | ||
| 7 | + v0_logical_tensor %$0@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10002 ADD(%View_x@3, %View_y@4) token(); | ||
| 8 | + yield %$0@5; | ||
| 9 | + } else { | ||
| 10 | + v0_logical_tensor %$1@6 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10003 SUB(%View_x@3, %View_y@4) token(); | ||
| 11 | + yield %$1@6; | ||
| 12 | + } | ||
| 13 | + v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10004 ASSEMBLE(%tmp_0@5) token() #toOffset(Unsupported); | ||
| 14 | + continue %loop_idx_10, %tmp_0@5, %View_x@3, %View_y@4; | ||
| 15 | + } | ||
| 16 | + return %x@0, %y@1, %out@2; | ||
| 17 | + } | ||
| 18 | +} | ||
| @@ -0,0 +1,16 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + int64_t %i_0, v0_logical_tensor %xv_1@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 4, 1 iter { none %i = %None; none %xv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_x@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %xv_0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = if v0eq(loop_idx_10, 0) then { | ||
| 6 | + v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10001 ADDS(%View_x@2) token(); | ||
| 7 | + yield %$0@3; | ||
| 8 | + } else { | ||
| 9 | + yield %View_x@2; | ||
| 10 | + } | ||
| 11 | + v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]) = !10002 ASSEMBLE(%xv_0@3) token() #toOffset(Unsupported); | ||
| 12 | + continue %loop_idx_10, %xv_0@3; | ||
| 13 | + } | ||
| 14 | + return %x@0, %out@1; | ||
| 15 | + } | ||
| 16 | +} | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %b@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %av_0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), v0_logical_tensor %bv_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), v0_logical_tensor %cv_0@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), int64_t %i_0 = for %loop_idx_10 inrange 0, 2, 1 iter { none %av = %None; none %bv = %None; none %cv = %None; none %i = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_a@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%a@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %View_b@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10001 VIEW(%b@1) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 6 | + v0_logical_tensor %$0@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10002 ADD(%View_a@3, %View_b@4) token(); | ||
| 7 | + v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10003 ASSEMBLE(%$0@5) token() #toOffset(Unsupported); | ||
| 8 | + continue %View_a@3, %View_b@4, %$0@5, %loop_idx_10; | ||
| 9 | + } | ||
| 10 | + return %a@0, %b@1, %c@2; | ||
| 11 | + } | ||
| 12 | +} | ||
| @@ -0,0 +1,11 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %b@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10000 ADD(%a@0, %b@1) token(); | ||
| 4 | + int64_t %i_0, v0_logical_tensor %tv_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = for %loop_idx_14 inrange 0, 2, 1 iter { none %i = %None; none %tv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 5 | + v0_logical_tensor %View_@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10001 VIEW(%$0@3) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 6 | + v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10002 ASSEMBLE(%View_@4) token() #toOffset(Unsupported); | ||
| 7 | + continue %loop_idx_14, %View_@4; | ||
| 8 | + } | ||
| 9 | + return %a@0, %b@1, %c@2; | ||
| 10 | + } | ||
| 11 | +} | ||
| @@ -0,0 +1,13 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + int64_t %i_0, int64_t %j_2, v0_logical_tensor %xv_2@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(v0add(v0mul(loop_idx_10, 2), loop_idx_16), 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 2, 1 iter { none %i = %None; none %j = %None; none %xv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + int64_t %j_1, v0_logical_tensor %xv_1@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(v0add(v0mul(loop_idx_10, 2), loop_idx_16), 16)), 0), 16), 16]) = for %loop_idx_16 inrange 0, 2, 1 iter { none %j_0 = %None; none %xv_0 = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 5 | + v0_logical_tensor %View_x@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(v0add(v0mul(loop_idx_10, 2), loop_idx_16), 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 6 | + v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]) = !10001 ASSEMBLE(%View_x@2) token() #toOffset(Unsupported); | ||
| 7 | + continue %loop_idx_16, %View_x@2; | ||
| 8 | + } | ||
| 9 | + continue %loop_idx_10, %j_1, %xv_1@2; | ||
| 10 | + } | ||
| 11 | + return %x@0, %out@1; | ||
| 12 | + } | ||
| 13 | +} | ||
| @@ -0,0 +1,11 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %b@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10000 ADD(%a@0, %b@1) token(); | ||
| 4 | + v0_logical_tensor %cv_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_14, 16)), 0), 16), 16]), int64_t %i_0 = for %loop_idx_14 inrange 0, 2, 1 iter { none %cv = %None; none %i = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 5 | + v0_logical_tensor %View_@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_14, 16)), 0), 16), 16]) = !10001 VIEW(%$0@3) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 6 | + v0_logical_tensor %c@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10002 ASSEMBLE(%View_@4) token() #toOffset(Unsupported); | ||
| 7 | + continue %View_@4, %loop_idx_14; | ||
| 8 | + } | ||
| 9 | + return %a@0, %b@1, %c@2; | ||
| 10 | + } | ||
| 11 | +} | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %b@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10000 ADD(%a@0, %b@1) token(); | ||
| 4 | + v0_logical_tensor %out@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10001 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 5 | + return %a@0, %b@1, %out@2; | ||
| 6 | + } | ||
| 7 | +} | ||
| @@ -0,0 +1,15 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + int64_t %i_0, v0_logical_tensor %xv_0@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 2, 1 iter { none %i = %None; none %xv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_x@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]) = !10001 ASSEMBLE(%View_x@2) token() #toOffset(Unsupported); | ||
| 6 | + continue %loop_idx_10, %View_x@2; | ||
| 7 | + } | ||
| 8 | + int64_t %i_2, v0_logical_tensor %xv_2@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_39, 16)), 0), 16), 16]) = for %loop_idx_39 inrange 0, 2, 1 iter { int64_t %i_1 = %i_0; v0_logical_tensor %xv_1@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_10, 16)), 0), 16), 16]) = %xv_0@2; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 9 | + v0_logical_tensor %View_x_2@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(64, v0mul(loop_idx_39, 16)), 0), 16), 16]) = !10002 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 10 | + v0_logical_tensor %out@1 #dtype(float) #shape([64, 16]) #offset([0, 0]) #dynvalidshape([64, 16]) = !10003 ASSEMBLE(%View_x_2@3) token() #toOffset(Unsupported); | ||
| 11 | + continue %loop_idx_39, %View_x_2@3; | ||
| 12 | + } | ||
| 13 | + return %x@0, %out@1; | ||
| 14 | + } | ||
| 15 | +} | ||
| @@ -0,0 +1,18 @@ | |||
| 1 | +program #entry() { | ||
| 2 | + function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 3 | + v0_logical_tensor %a1_1@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), v0_logical_tensor %a2_0@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]), int64_t %i_0, v0_logical_tensor %xv_0@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = for %loop_idx_10 inrange 0, 2, 1 iter { none %a1 = %None; none %a2 = %None; none %i = %None; none %xv = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 4 | + v0_logical_tensor %View_x@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10000 VIEW(%x@0) token() #fromOffset(Unsupported) #toValidShape(Unsupported); | ||
| 5 | + v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10001 ADDS(%View_x@2) token(); | ||
| 6 | + v0_logical_tensor %a1_0@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = if v0eq(loop_idx_10, 0) then { | ||
| 7 | + v0_logical_tensor %$1@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10002 ADDS(%$0@3) token(); | ||
| 8 | + yield %$1@4; | ||
| 9 | + } else { | ||
| 10 | + yield %$0@3; | ||
| 11 | + } | ||
| 12 | + v0_logical_tensor %$3@5 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([v0min(v0max(v0sub(32, v0mul(loop_idx_10, 16)), 0), 16), 16]) = !10003 ADDS(%a1_0@4) token(); | ||
| 13 | + v0_logical_tensor %out@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10004 ASSEMBLE(%$3@5) token() #toOffset(Unsupported); | ||
| 14 | + continue %a1_0@4, %$3@5, %loop_idx_10, %View_x@2; | ||
| 15 | + } | ||
| 16 | + return %x@0, %out@1; | ||
| 17 | + } | ||
| 18 | +} | ||
| @@ -24,8 +24,8 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 24 | 24 | ||
| 25 | _GOLDEN_DIR = Path(__file__).parent | 25 | _GOLDEN_DIR = Path(__file__).parent |
| 26 | 26 | ||
| 27 | -IR_THEN_ELSE = (_GOLDEN_DIR / "test_dyn_valid_shape_clone_then_else.pypto").read_text() | 27 | +IR_THEN_ELSE = _GOLDEN_DIR / "test_dyn_valid_shape_clone_then_else.pypto" |
| 28 | -IR_NO_CROSS = (_GOLDEN_DIR / "test_dyn_valid_shape_no_cross_branch_contamination.pypto").read_text() | 28 | +IR_NO_CROSS = _GOLDEN_DIR / "test_dyn_valid_shape_no_cross_branch_contamination.pypto" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | def test_view_dyn_valid_shape_clone_then_else(): | 31 | def test_view_dyn_valid_shape_clone_then_else(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_fillpad.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_fillpad.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_fillpad(): | 21 | def test_fillpad(): |
| @@ -16,7 +16,7 @@ from ..test_common import check_snapshot | |||
| 16 | 16 | ||
| 17 | _GOLDEN_DIR = Path(__file__).parent | 17 | _GOLDEN_DIR = Path(__file__).parent |
| 18 | 18 | ||
| 19 | -IR = (_GOLDEN_DIR / "test_merge_chain_clonemap.pypto").read_text() | 19 | +IR = _GOLDEN_DIR / "test_merge_chain_clonemap.pypto" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | def test_merge_chain_clonemap(): | 22 | def test_merge_chain_clonemap(): |
| @@ -14,7 +14,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 14 | 14 | ||
| 15 | _GOLDEN_DIR = Path(__file__).parent | 15 | _GOLDEN_DIR = Path(__file__).parent |
| 16 | 16 | ||
| 17 | -IR = (_GOLDEN_DIR / "test_merge_pass1.pypto").read_text() | 17 | +IR = _GOLDEN_DIR / "test_merge_pass1.pypto" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | def test_merge_pass1(): | 20 | def test_merge_pass1(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass2.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass2.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass2(): | 21 | def test_merge_pass2(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass3.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass3.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass3(): | 21 | def test_merge_pass3(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass4.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass4.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass4(): | 21 | def test_merge_pass4(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass5.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass5.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass5(): | 21 | def test_merge_pass5(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass6.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass6.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass6(): | 21 | def test_merge_pass6(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass7.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass7.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass7(): | 21 | def test_merge_pass7(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_pass8.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_pass8.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_pass8(): | 21 | def test_merge_pass8(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_merge_returnstmt_barrier.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_merge_returnstmt_barrier.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_merge_return_stmt_barrier(): | 21 | def test_merge_return_stmt_barrier(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_oi_update.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_oi_update.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_oi_update(): | 21 | def test_oi_update(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_oi_update1.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_oi_update1.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_oi_update1(): | 21 | def test_oi_update1(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_reshape.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_reshape.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def reshape_kernel( | 21 | def reshape_kernel( |
| @@ -16,7 +16,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 16 | 16 | ||
| 17 | _GOLDEN_DIR = Path(__file__).parent | 17 | _GOLDEN_DIR = Path(__file__).parent |
| 18 | 18 | ||
| 19 | -IR = (_GOLDEN_DIR / "test_type_conflict.pypto").read_text() | 19 | +IR = _GOLDEN_DIR / "test_type_conflict.pypto" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | def test_type_conflict(): | 22 | def test_type_conflict(): |
| @@ -15,7 +15,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 15 | 15 | ||
| 16 | _GOLDEN_DIR = Path(__file__).parent | 16 | _GOLDEN_DIR = Path(__file__).parent |
| 17 | 17 | ||
| 18 | -IR = (_GOLDEN_DIR / "test_unroll_list.pypto").read_text() | 18 | +IR = _GOLDEN_DIR / "test_unroll_list.pypto" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | def test_unroll_list(): | 21 | def test_unroll_list(): |
| @@ -14,7 +14,7 @@ from ..test_common import check_snapshot, run_merge_pass | |||
| 14 | 14 | ||
| 15 | _GOLDEN_DIR = Path(__file__).parent | 15 | _GOLDEN_DIR = Path(__file__).parent |
| 16 | 16 | ||
| 17 | -IR = (_GOLDEN_DIR / "test_yield_scalar.pypto").read_text() | 17 | +IR = _GOLDEN_DIR / "test_yield_scalar.pypto" |
| 18 | 18 | ||
| 19 | def test_yield_symbolic_scalar(): | 19 | def test_yield_symbolic_scalar(): |
| 20 | def foo(x, y): | 20 | def foo(x, y): |
| @@ -55,7 +55,7 @@ def test_index_put_keeps_write_after_read_dependency(): | |||
| 55 | _tensor((8, 16), "values"), | 55 | _tensor((8, 16), "values"), |
| 56 | _tensor((16, 16), "out"), | 56 | _tensor((16, 16), "out"), |
| 57 | ) | 57 | ) |
| 58 | - check_snapshot(after_remove, (_GOLDEN_DIR / "test_index_put_keeps_write_after_read_dependency.pypto").read_text()) | 58 | + check_snapshot(after_remove, _GOLDEN_DIR / "test_index_put_keeps_write_after_read_dependency.pypto") |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | def test_index_add_keeps_write_after_read_dependency(): | 61 | def test_index_add_keeps_write_after_read_dependency(): |
| @@ -71,7 +71,7 @@ def test_index_add_keeps_write_after_read_dependency(): | |||
| 71 | _tensor((8, 16), "source"), | 71 | _tensor((8, 16), "source"), |
| 72 | _tensor((16, 16), "out"), | 72 | _tensor((16, 16), "out"), |
| 73 | ) | 73 | ) |
| 74 | - check_snapshot(after_remove, (_GOLDEN_DIR / "test_index_add_keeps_write_after_read_dependency.pypto").read_text()) | 74 | + check_snapshot(after_remove, _GOLDEN_DIR / "test_index_add_keeps_write_after_read_dependency.pypto") |
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | def test_scatter_update_keeps_write_after_read_dependency(): | 77 | def test_scatter_update_keeps_write_after_read_dependency(): |
| @@ -88,7 +88,7 @@ def test_scatter_update_keeps_write_after_read_dependency(): | |||
| 88 | _tensor((16, 16), "out"), | 88 | _tensor((16, 16), "out"), |
| 89 | ) | 89 | ) |
| 90 | check_snapshot( | 90 | check_snapshot( |
| 91 | - after_remove, (_GOLDEN_DIR / "test_scatter_update_keeps_write_after_read_dependency.pypto").read_text()) | 91 | + after_remove, _GOLDEN_DIR / "test_scatter_update_keeps_write_after_read_dependency.pypto") |
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | def test_axpy_keeps_write_after_read_dependency(): | 94 | def test_axpy_keeps_write_after_read_dependency(): |
| @@ -103,7 +103,7 @@ def test_axpy_keeps_write_after_read_dependency(): | |||
| 103 | _tensor((16, 16), "source"), | 103 | _tensor((16, 16), "source"), |
| 104 | _tensor((16, 16), "out"), | 104 | _tensor((16, 16), "out"), |
| 105 | ) | 105 | ) |
| 106 | - check_snapshot(after_remove, (_GOLDEN_DIR / "test_axpy_keeps_write_after_read_dependency.pypto").read_text()) | 106 | + check_snapshot(after_remove, _GOLDEN_DIR / "test_axpy_keeps_write_after_read_dependency.pypto") |
| 107 | 107 | ||
| 108 | 108 | ||
| 109 | def test_inplace_reshape_keeps_write_after_read_dependency(): | 109 | def test_inplace_reshape_keeps_write_after_read_dependency(): |
| @@ -118,7 +118,7 @@ def test_inplace_reshape_keeps_write_after_read_dependency(): | |||
| 118 | _tensor((16, 16), "out"), | 118 | _tensor((16, 16), "out"), |
| 119 | ) | 119 | ) |
| 120 | check_snapshot( | 120 | check_snapshot( |
| 121 | - after_remove, (_GOLDEN_DIR / "test_inplace_reshape_keeps_write_after_read_dependency.pypto").read_text()) | 121 | + after_remove, _GOLDEN_DIR / "test_inplace_reshape_keeps_write_after_read_dependency.pypto") |
| 122 | 122 | ||
| 123 | 123 | ||
| 124 | def test_inplace_scatter_keeps_write_after_read_dependency(): | 124 | def test_inplace_scatter_keeps_write_after_read_dependency(): |
| @@ -152,7 +152,7 @@ def test_atomic_add_target_is_carried_through_loop(): | |||
| 152 | _tensor((8, 16), "source"), | 152 | _tensor((8, 16), "source"), |
| 153 | _tensor((16, 16), "out"), | 153 | _tensor((16, 16), "out"), |
| 154 | ) | 154 | ) |
| 155 | - check_snapshot(after_remove, (_GOLDEN_DIR / "test_atomic_add_target_is_carried_through_loop.pypto").read_text()) | 155 | + check_snapshot(after_remove, _GOLDEN_DIR / "test_atomic_add_target_is_carried_through_loop.pypto") |
| 156 | 156 | ||
| 157 | 157 | ||
| 158 | def test_continuous_inplace_updates_latest_alias_state(): | 158 | def test_continuous_inplace_updates_latest_alias_state(): |
| @@ -170,7 +170,7 @@ def test_continuous_inplace_updates_latest_alias_state(): | |||
| 170 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], | 170 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], |
| 171 | create_new_logical_tensor=True, | 171 | create_new_logical_tensor=True, |
| 172 | ) | 172 | ) |
| 173 | - check_snapshot(after_infer, (_GOLDEN_DIR / "test_continuous_inplace_updates_latest_alias_state.pypto").read_text()) | 173 | + check_snapshot(after_infer, _GOLDEN_DIR / "test_continuous_inplace_updates_latest_alias_state.pypto") |
| 174 | 174 | ||
| 175 | 175 | ||
| 176 | def test_read_alias_then_write_origin_keeps_war(): | 176 | def test_read_alias_then_write_origin_keeps_war(): |
| @@ -191,7 +191,7 @@ def test_read_alias_then_write_origin_keeps_war(): | |||
| 191 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], | 191 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], |
| 192 | create_new_logical_tensor=True, | 192 | create_new_logical_tensor=True, |
| 193 | ) | 193 | ) |
| 194 | - check_snapshot(after_infer, (_GOLDEN_DIR / "test_read_alias_then_write_origin_keeps_war.pypto").read_text()) | 194 | + check_snapshot(after_infer, _GOLDEN_DIR / "test_read_alias_then_write_origin_keeps_war.pypto") |
| 195 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] | 195 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] |
| 196 | adds = next(op for op in tensor_ops if op.opcode == "ADDS") | 196 | adds = next(op for op in tensor_ops if op.opcode == "ADDS") |
| 197 | index_put = next(op for op in tensor_ops if op.opcode == "INDEX_PUT") | 197 | index_put = next(op for op in tensor_ops if op.opcode == "INDEX_PUT") |
| @@ -216,7 +216,7 @@ def test_read_origin_after_inplace_on_alias_keeps_raw(): | |||
| 216 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], | 216 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], |
| 217 | create_new_logical_tensor=True, | 217 | create_new_logical_tensor=True, |
| 218 | ) | 218 | ) |
| 219 | - check_snapshot(after_infer, (_GOLDEN_DIR / "test_read_origin_after_inplace_on_alias_keeps_raw.pypto").read_text()) | 219 | + check_snapshot(after_infer, _GOLDEN_DIR / "test_read_origin_after_inplace_on_alias_keeps_raw.pypto") |
| 220 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] | 220 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] |
| 221 | index_add = next(op for op in tensor_ops if op.opcode == "INDEX_ADD") | 221 | index_add = next(op for op in tensor_ops if op.opcode == "INDEX_ADD") |
| 222 | adds = next(op for op in tensor_ops if op.opcode == "ADDS") | 222 | adds = next(op for op in tensor_ops if op.opcode == "ADDS") |
| @@ -242,7 +242,7 @@ def test_write_alias_then_write_origin_keeps_waw(): | |||
| 242 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], | 242 | pipeline=[("infer_token_pass", ir.Pass.infer_token_pass())], |
| 243 | create_new_logical_tensor=True, | 243 | create_new_logical_tensor=True, |
| 244 | ) | 244 | ) |
| 245 | - check_snapshot(after_infer, (_GOLDEN_DIR / "test_write_alias_then_write_origin_keeps_waw.pypto").read_text()) | 245 | + check_snapshot(after_infer, _GOLDEN_DIR / "test_write_alias_then_write_origin_keeps_waw.pypto") |
| 246 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] | 246 | tensor_ops = [stmt for stmt in after_infer.body if isinstance(stmt, ir.TensorOpStmt)] |
| 247 | index_add = next(op for op in tensor_ops if op.opcode == "INDEX_ADD") | 247 | index_add = next(op for op in tensor_ops if op.opcode == "INDEX_ADD") |
| 248 | index_put = next(op for op in tensor_ops if op.opcode == "INDEX_PUT") | 248 | index_put = next(op for op in tensor_ops if op.opcode == "INDEX_PUT") |
| @@ -17,7 +17,7 @@ from ..test_common import _ssa_verify, check_snapshot | |||
| 17 | 17 | ||
| 18 | _GOLDEN_DIR = Path(__file__).parent | 18 | _GOLDEN_DIR = Path(__file__).parent |
| 19 | 19 | ||
| 20 | -IR = (_GOLDEN_DIR / "test_assemble_outcast_versions.pypto").read_text() | 20 | +IR = _GOLDEN_DIR / "test_assemble_outcast_versions.pypto" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | def _run_root_builder(func, *args): | 23 | def _run_root_builder(func, *args): |
| @@ -10,7 +10,6 @@ | |||
| 10 | """Tests for ir.Pass.infer_token_pass.""" | 10 | """Tests for ir.Pass.infer_token_pass.""" |
| 11 | 11 | ||
| 12 | from pathlib import Path | 12 | from pathlib import Path |
| 13 | -import re | ||
| 14 | 13 | ||
| 15 | import pypto | 14 | import pypto |
| 16 | from pypto import ir | 15 | from pypto import ir |
| @@ -34,33 +33,7 @@ def _condition(): | |||
| 34 | return pypto.Tensor(shape=(-1,), dtype=pypto.DT_INT32, name="condition") | 33 | return pypto.Tensor(shape=(-1,), dtype=pypto.DT_INT32, name="condition") |
| 35 | 34 | ||
| 36 | 35 | ||
| 37 | -class _NormalizedSnapshot: | 36 | +IR_0 = _GOLDEN_DIR / "test_infer_pass_test_repeated_input.pypto" |
| 38 | - def __init__(self, func): | ||
| 39 | - self._func = func | ||
| 40 | - self.name = func.name | ||
| 41 | - | ||
| 42 | - def __str__(self): | ||
| 43 | - return _normalize_token_names(str(self._func)) | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -def _normalize_token_names(text): | ||
| 47 | - token_names = {} | ||
| 48 | - pattern = re.compile(r"(_[A-Za-z0-9]+_token_|__token_|_if_token_|_for_token_)\d+") | ||
| 49 | - | ||
| 50 | - def replace(match): | ||
| 51 | - name = match.group(0) | ||
| 52 | - if name not in token_names: | ||
| 53 | - token_names[name] = match.group(1) + str(len(token_names) + 1) | ||
| 54 | - return token_names[name] | ||
| 55 | - | ||
| 56 | - return re.sub(r"loop_idx_\d+", "loop_idx_N", pattern.sub(replace, text)) | ||
| 57 | - | ||
| 58 | - | ||
| 59 | -def _check_snapshot(func, golden): | ||
| 60 | - check_snapshot(_NormalizedSnapshot(func), _normalize_token_names(golden)) | ||
| 61 | - | ||
| 62 | - | ||
| 63 | -IR_0 = (_GOLDEN_DIR / "test_infer_pass_test_repeated_input.pypto").read_text() | ||
| 64 | def test_repeated_input(): | 37 | def test_repeated_input(): |
| 65 | def foo(x): | 38 | def foo(x): |
| 66 | pypto.add(x, x) | 39 | pypto.add(x, x) |
| @@ -69,7 +42,7 @@ def test_repeated_input(): | |||
| 69 | check_snapshot(func, IR_0) | 42 | check_snapshot(func, IR_0) |
| 70 | 43 | ||
| 71 | 44 | ||
| 72 | -IR_1 = (_GOLDEN_DIR / "test_infer_pass_test_multiple_outputs.pypto").read_text() | 45 | +IR_1 = _GOLDEN_DIR / "test_infer_pass_test_multiple_outputs.pypto" |
| 73 | def test_multiple_outputs(): | 46 | def test_multiple_outputs(): |
| 74 | def foo(x): | 47 | def foo(x): |
| 75 | pypto.topk(x, 2) | 48 | pypto.topk(x, 2) |
| @@ -78,7 +51,7 @@ def test_multiple_outputs(): | |||
| 78 | check_snapshot(func, IR_1) | 51 | check_snapshot(func, IR_1) |
| 79 | 52 | ||
| 80 | 53 | ||
| 81 | -IR_2 = (_GOLDEN_DIR / "test_infer_pass_test_multiple_reads.pypto").read_text() | 54 | +IR_2 = _GOLDEN_DIR / "test_infer_pass_test_multiple_reads.pypto" |
| 82 | def test_multiple_reads(): | 55 | def test_multiple_reads(): |
| 83 | def foo(x): | 56 | def foo(x): |
| 84 | lhs = x + 1.0 | 57 | lhs = x + 1.0 |
| @@ -89,7 +62,7 @@ def test_multiple_reads(): | |||
| 89 | check_snapshot(func, IR_2) | 62 | check_snapshot(func, IR_2) |
| 90 | 63 | ||
| 91 | 64 | ||
| 92 | -IR_3 = (_GOLDEN_DIR / "test_infer_pass_test_read_after_write.pypto").read_text() | 65 | +IR_3 = _GOLDEN_DIR / "test_infer_pass_test_read_after_write.pypto" |
| 93 | def test_read_after_write(): | 66 | def test_read_after_write(): |
| 94 | def foo(a, b): | 67 | def foo(a, b): |
| 95 | value = pypto.exp(b) | 68 | value = pypto.exp(b) |
| @@ -101,7 +74,7 @@ def test_read_after_write(): | |||
| 101 | check_snapshot(func, IR_3) | 74 | check_snapshot(func, IR_3) |
| 102 | 75 | ||
| 103 | 76 | ||
| 104 | -IR_4 = (_GOLDEN_DIR / "test_infer_pass_test_write_after_read.pypto").read_text() | 77 | +IR_4 = _GOLDEN_DIR / "test_infer_pass_test_write_after_read.pypto" |
| 105 | def test_write_after_read(): | 78 | def test_write_after_read(): |
| 106 | def foo(x): | 79 | def foo(x): |
| 107 | pypto.set_vec_tile_shapes(16, 16) | 80 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -115,7 +88,7 @@ def test_write_after_read(): | |||
| 115 | check_snapshot(func, IR_4) | 88 | check_snapshot(func, IR_4) |
| 116 | 89 | ||
| 117 | 90 | ||
| 118 | -IR_5 = (_GOLDEN_DIR / "test_infer_pass_test_read_read_write.pypto").read_text() | 91 | +IR_5 = _GOLDEN_DIR / "test_infer_pass_test_read_read_write.pypto" |
| 119 | def test_read_read_write(): | 92 | def test_read_read_write(): |
| 120 | def foo(a): | 93 | def foo(a): |
| 121 | value = pypto.exp(a) | 94 | value = pypto.exp(a) |
| @@ -126,7 +99,7 @@ def test_read_read_write(): | |||
| 126 | check_snapshot(func, IR_5) | 99 | check_snapshot(func, IR_5) |
| 127 | 100 | ||
| 128 | 101 | ||
| 129 | -IR_6 = (_GOLDEN_DIR / "test_infer_pass_test_write_write_read.pypto").read_text() | 102 | +IR_6 = _GOLDEN_DIR / "test_infer_pass_test_write_write_read.pypto" |
| 130 | def test_write_write_read(): | 103 | def test_write_write_read(): |
| 131 | def foo(a, b, c): | 104 | def foo(a, b, c): |
| 132 | first = pypto.exp(b) | 105 | first = pypto.exp(b) |
| @@ -139,7 +112,7 @@ def test_write_write_read(): | |||
| 139 | check_snapshot(func, IR_6) | 112 | check_snapshot(func, IR_6) |
| 140 | 113 | ||
| 141 | 114 | ||
| 142 | -IR_7 = (_GOLDEN_DIR / "test_infer_pass_test_if_input.pypto").read_text() | 115 | +IR_7 = _GOLDEN_DIR / "test_infer_pass_test_if_input.pypto" |
| 143 | def test_if_input(): | 116 | def test_if_input(): |
| 144 | def foo(x, aux, out, condition): | 117 | def foo(x, aux, out, condition): |
| 145 | pypto.set_vec_tile_shapes(16, 16) | 118 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -152,10 +125,10 @@ def test_if_input(): | |||
| 152 | pypto.assemble(result, [0, 0], out) | 125 | pypto.assemble(result, [0, 0], out) |
| 153 | 126 | ||
| 154 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) | 127 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) |
| 155 | - _check_snapshot(func, IR_7) | 128 | + check_snapshot(func, IR_7) |
| 156 | 129 | ||
| 157 | 130 | ||
| 158 | -IR_8 = (_GOLDEN_DIR / "test_infer_pass_test_if_output.pypto").read_text() | 131 | +IR_8 = _GOLDEN_DIR / "test_infer_pass_test_if_output.pypto" |
| 159 | def test_if_output(): | 132 | def test_if_output(): |
| 160 | def foo(x, aux, out, condition): | 133 | def foo(x, aux, out, condition): |
| 161 | pypto.set_vec_tile_shapes(16, 16) | 134 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -169,10 +142,10 @@ def test_if_output(): | |||
| 169 | pypto.assemble(result, [0, 0], out) | 142 | pypto.assemble(result, [0, 0], out) |
| 170 | 143 | ||
| 171 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) | 144 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) |
| 172 | - _check_snapshot(func, IR_8) | 145 | + check_snapshot(func, IR_8) |
| 173 | 146 | ||
| 174 | 147 | ||
| 175 | -IR_9 = (_GOLDEN_DIR / "test_infer_pass_test_if_passthrough.pypto").read_text() | 148 | +IR_9 = _GOLDEN_DIR / "test_infer_pass_test_if_passthrough.pypto" |
| 176 | def test_if_passthrough(): | 149 | def test_if_passthrough(): |
| 177 | def foo(x, aux, out, condition): | 150 | def foo(x, aux, out, condition): |
| 178 | pypto.set_vec_tile_shapes(16, 16) | 151 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -185,10 +158,10 @@ def test_if_passthrough(): | |||
| 185 | pypto.assemble(result, [0, 0], out) | 158 | pypto.assemble(result, [0, 0], out) |
| 186 | 159 | ||
| 187 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) | 160 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) |
| 188 | - _check_snapshot(func, IR_9) | 161 | + check_snapshot(func, IR_9) |
| 189 | 162 | ||
| 190 | 163 | ||
| 191 | -IR_10 = (_GOLDEN_DIR / "test_infer_pass_test_if_multiple_reads.pypto").read_text() | 164 | +IR_10 = _GOLDEN_DIR / "test_infer_pass_test_if_multiple_reads.pypto" |
| 192 | def test_if_multiple_reads(): | 165 | def test_if_multiple_reads(): |
| 193 | def foo(x, aux, out, condition): | 166 | def foo(x, aux, out, condition): |
| 194 | pypto.set_vec_tile_shapes(16, 16) | 167 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -203,10 +176,10 @@ def test_if_multiple_reads(): | |||
| 203 | pypto.assemble(result, [0, 0], out) | 176 | pypto.assemble(result, [0, 0], out) |
| 204 | 177 | ||
| 205 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) | 178 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) |
| 206 | - _check_snapshot(func, IR_10) | 179 | + check_snapshot(func, IR_10) |
| 207 | 180 | ||
| 208 | 181 | ||
| 209 | -IR_11 = (_GOLDEN_DIR / "test_infer_pass_test_for_input.pypto").read_text() | 182 | +IR_11 = _GOLDEN_DIR / "test_infer_pass_test_for_input.pypto" |
| 210 | def test_for_input(): | 183 | def test_for_input(): |
| 211 | def foo(x, aux, out): | 184 | def foo(x, aux, out): |
| 212 | pypto.set_vec_tile_shapes(16, 16) | 185 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -217,10 +190,10 @@ def test_for_input(): | |||
| 217 | pypto.assemble(result, [0, 0], out) | 190 | pypto.assemble(result, [0, 0], out) |
| 218 | 191 | ||
| 219 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) | 192 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) |
| 220 | - _check_snapshot(func, IR_11) | 193 | + check_snapshot(func, IR_11) |
| 221 | 194 | ||
| 222 | 195 | ||
| 223 | -IR_12 = (_GOLDEN_DIR / "test_infer_pass_test_for_output.pypto").read_text() | 196 | +IR_12 = _GOLDEN_DIR / "test_infer_pass_test_for_output.pypto" |
| 224 | def test_for_output(): | 197 | def test_for_output(): |
| 225 | def foo(x, aux, out): | 198 | def foo(x, aux, out): |
| 226 | pypto.set_vec_tile_shapes(16, 16) | 199 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -231,10 +204,10 @@ def test_for_output(): | |||
| 231 | pypto.assemble(result, [0, 0], out) | 204 | pypto.assemble(result, [0, 0], out) |
| 232 | 205 | ||
| 233 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) | 206 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) |
| 234 | - _check_snapshot(func, IR_12) | 207 | + check_snapshot(func, IR_12) |
| 235 | 208 | ||
| 236 | 209 | ||
| 237 | -IR_13 = (_GOLDEN_DIR / "test_infer_pass_test_if_none.pypto").read_text() | 210 | +IR_13 = _GOLDEN_DIR / "test_infer_pass_test_if_none.pypto" |
| 238 | def test_if_none(): | 211 | def test_if_none(): |
| 239 | def foo(x, aux, out, condition): | 212 | def foo(x, aux, out, condition): |
| 240 | pypto.set_vec_tile_shapes(16, 16) | 213 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -245,10 +218,10 @@ def test_if_none(): | |||
| 245 | pypto.assemble(result, [0, 0], out) | 218 | pypto.assemble(result, [0, 0], out) |
| 246 | 219 | ||
| 247 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) | 220 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out"), _condition()) |
| 248 | - _check_snapshot(func, IR_13) | 221 | + check_snapshot(func, IR_13) |
| 249 | 222 | ||
| 250 | 223 | ||
| 251 | -IR_14 = (_GOLDEN_DIR / "test_infer_pass_test_for_read_output.pypto").read_text() | 224 | +IR_14 = _GOLDEN_DIR / "test_infer_pass_test_for_read_output.pypto" |
| 252 | def test_for_read_output(): | 225 | def test_for_read_output(): |
| 253 | def foo(x, aux, out): | 226 | def foo(x, aux, out): |
| 254 | pypto.set_vec_tile_shapes(16, 16) | 227 | pypto.set_vec_tile_shapes(16, 16) |
| @@ -259,4 +232,4 @@ def test_for_read_output(): | |||
| 259 | pypto.assemble(read, [0, 0], out) | 232 | pypto.assemble(read, [0, 0], out) |
| 260 | 233 | ||
| 261 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) | 234 | func = _run_infer_token_pass(foo, _tensor(), _tensor("aux"), _tensor("out")) |
| 262 | - _check_snapshot(func, IR_14) | 235 | + check_snapshot(func, IR_14) |
| @@ -1,9 +1,9 @@ | |||
| 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { |
| 2 | v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$0_w = !10000 VEC_DUP() token(); | 2 | v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$0_w = !10000 VEC_DUP() token(); |
| 3 | v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | 3 | v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); |
| 4 | - int64_t %__0, v0_logical_tensor %result_0@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %result_0_w_for = for %loop_idx_N inrange 0, 2, 1 iter { none %_ = %None; none %result = %None; token %result_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | 4 | + int64_t %__0, v0_logical_tensor %result_0@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %result_0_w_for = for %loop_idx_28 inrange 0, 2, 1 iter { none %_ = %None; none %result = %None; token %result_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { |
| 5 | v0_logical_tensor %$1@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$1_w, token %aux_1_r, token %x_r = !10002 ADD(%aux_1@1, %x@0) token(%aux_1_w); | 5 | v0_logical_tensor %$1@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$1_w, token %aux_1_r, token %x_r = !10002 ADD(%aux_1@1, %x@0) token(%aux_1_w); |
| 6 | - continue %loop_idx_N, %$1@4, %$1_w; | 6 | + continue %loop_idx_28, %$1@4, %$1_w; |
| 7 | } | 7 | } |
| 8 | v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %result_0_r = !10003 ASSEMBLE(%result_0@4) token(%result_0_w_for) #toOffset(Unsupported); | 8 | v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %result_0_r = !10003 ASSEMBLE(%result_0@4) token(%result_0_w_for) #toOffset(Unsupported); |
| 9 | return %x@0, %aux_1@1, %out_1@2; | 9 | return %x@0, %aux_1@1, %out_1@2; |
| @@ -1,8 +1,8 @@ | |||
| 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { |
| 2 | - v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), int64_t %i_0, v0_logical_tensor %src_0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %aux_5_w_for, token %src_0_w_for = for %loop_idx_N inrange 0, 2, 1 iter { v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = %aux@1; none %i = %None; none %src = %None; token %aux_5_w_for_iter = %None; token %src_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | 2 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), int64_t %i_0, v0_logical_tensor %src_0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %aux_5_w_for, token %src_0_w_for = for %loop_idx_10 inrange 0, 2, 1 iter { v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = %aux@1; none %i = %None; none %src = %None; token %aux_5_w_for_iter = %None; token %src_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { |
| 3 | v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$0_w = !10000 VEC_DUP() token(); | 3 | v0_logical_tensor %$0@3 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$0_w = !10000 VEC_DUP() token(); |
| 4 | v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | 4 | v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); |
| 5 | - continue %aux_3@1, %loop_idx_N, %$0@3, %aux_3_w, %$0_w; | 5 | + continue %aux_3@1, %loop_idx_10, %$0@3, %aux_3_w, %$0_w; |
| 6 | } | 6 | } |
| 7 | v0_logical_tensor %$2@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$2_w, token %x_r, token %aux_5_r = !10002 ADD(%x@0, %aux_5@1) token(%aux_5_w_for); | 7 | v0_logical_tensor %$2@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$2_w, token %x_r, token %aux_5_r = !10002 ADD(%x@0, %aux_5@1) token(%aux_5_w_for); |
| 8 | v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %$2_r = !10003 ASSEMBLE(%$2@4) token(%$2_w) #toOffset(Unsupported); | 8 | v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %$2_r = !10003 ASSEMBLE(%$2@4) token(%$2_w) #toOffset(Unsupported); |
| @@ -1,7 +1,7 @@ | |||
| 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | 1 | function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { |
| 2 | - int64_t %__0, v0_logical_tensor %read_0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %read_0_w_for, token %aux_r_for = for %loop_idx_N inrange 0, 2, 1 iter { none %_ = %None; none %read = %None; token %read_0_w_for_iter = %None; token %aux_r_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | 2 | + int64_t %__0, v0_logical_tensor %read_0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %read_0_w_for, token %aux_r_for = for %loop_idx_10 inrange 0, 2, 1 iter { none %_ = %None; none %read = %None; token %read_0_w_for_iter = %None; token %aux_r_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { |
| 3 | v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_r, token %x_r = !10000 ADD(%aux@1, %x@0) token(); | 3 | v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_r, token %x_r = !10000 ADD(%aux@1, %x@0) token(); |
| 4 | - continue %loop_idx_N, %$0@3, %$0_w, %aux_r; | 4 | + continue %loop_idx_10, %$0@3, %$0_w, %aux_r; |
| 5 | } | 5 | } |
| 6 | v0_logical_tensor %$2@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$2_w = !10001 VEC_DUP() token(); | 6 | v0_logical_tensor %$2@4 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$2_w = !10001 VEC_DUP() token(); |
| 7 | v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %$2_r = !10002 ASSEMBLE(%$2@4) token(%$2_w, %aux_r_for) #toOffset(Unsupported); | 7 | v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %$2_r = !10002 ASSEMBLE(%$2@4) token(%$2_w, %aux_r_for) #toOffset(Unsupported); |
| @@ -9,12 +9,16 @@ | |||
| 9 | # See LICENSE in the root of the software repository for the full text of the License. | 9 | # See LICENSE in the root of the software repository for the full text of the License. |
| 10 | """Tests for removing redundant token dependencies after MergeStmtsIntoIf.""" | 10 | """Tests for removing redundant token dependencies after MergeStmtsIntoIf.""" |
| 11 | 11 | ||
| 12 | +from pathlib import Path | ||
| 13 | + | ||
| 12 | import pypto | 14 | import pypto |
| 13 | from pypto import ir | 15 | from pypto import ir |
| 14 | from pypto.pil.compile_pipeline import compile_new_ir | 16 | from pypto.pil.compile_pipeline import compile_new_ir |
| 15 | 17 | ||
| 16 | from ..test_common import check_snapshot | 18 | from ..test_common import check_snapshot |
| 17 | 19 | ||
| 20 | +_GOLDEN_DIR = Path(__file__).parent / "test_remove_redundant_pass_data" | ||
| 21 | + | ||
| 18 | 22 | ||
| 19 | class _Snapshot: | 23 | class _Snapshot: |
| 20 | def __init__(self, name, text): | 24 | def __init__(self, name, text): |
| @@ -0,0 +1,5 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %$0_w, token %x_r = !10000 ADDS(%x@0) token(); | ||
| 3 | + v0_logical_tensor %out_1@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), token %out_1_w, token %$0_r = !10001 ASSEMBLE(%$0@2) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + return %x@0, %out_1@1; | ||
| 5 | +} | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_3_r = !10002 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 5 | + return %src@0, %aux_3@1, %$0@3; | ||
| 6 | +} | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$1_w = !10002 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$1_r = !10003 ASSEMBLE(%$1@4) token(%$1_w, %aux_1_w) #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$2_w, token %aux_3_r = !10004 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$3_w = !10005 VEC_DUP() token(); | ||
| 8 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_5_w, token %$3_r = !10006 ASSEMBLE(%$3@6) token(%$3_w, %aux_3_r) #toOffset(Unsupported); | ||
| 9 | + v0_logical_tensor %$4@7 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$4_w, token %$2_r, token %aux_5_r = !10007 ADD(%$2@5, %aux_5@1) token(%$2_w, %aux_5_w); | ||
| 10 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$4_r = !10008 ASSEMBLE(%$4@7) token(%$4_w) #toOffset(Unsupported); | ||
| 11 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 12 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$0_w, token %a_r, token %aux_r = !10000 ADD(%a@0, %aux@1) token(); | ||
| 3 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$1_w = !10001 VEC_DUP() token(); | ||
| 4 | + v0_logical_tensor %a_1@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %a_1_w, token %$1_r = !10002 ASSEMBLE(%$1@4) token(%$1_w, %a_r) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$2_w = !10003 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$2_r = !10004 ASSEMBLE(%$2@5) token(%$2_w, %aux_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$0_r = !10005 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 8 | + return %a_1@0, %aux_1@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_5_w, token %src_r = !10002 ASSEMBLE(%src@0) token(%aux_3_w) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_5_r = !10003 ADDS(%aux_5@1) token(%aux_5_w); | ||
| 6 | + return %src@0, %aux_5@1, %$0@3; | ||
| 7 | +} | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src_a@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %src_b@1 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %src_c@2 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_a_r = !10000 ASSEMBLE(%src_a@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_b_r = !10001 ASSEMBLE(%src_b@1) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_5_w, token %src_c_r = !10002 ASSEMBLE(%src_c@2) token(%aux_3_w) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$0@5 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_5_r = !10003 ADDS(%aux_5@3) token(%aux_5_w); | ||
| 6 | + return %src_a@0, %src_b@1, %src_c@2, %aux_5@3, %$0@5; | ||
| 7 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %value_0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %value_0_w_for = for %loop_idx_21 inrange 0, 2, 1 iter { none %value = %None; token %value_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 5 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_3_r = !10002 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 6 | + continue %$0@3, %$0_w; | ||
| 7 | + } | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %value_0_r = !10003 ASSEMBLE(%value_0@3) token(%value_0_w_for) #toOffset(Unsupported); | ||
| 9 | + return %src@0, %aux_3@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_7@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_7_w_for = for %loop_idx_5 inrange 0, 2, 1 iter { v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = %aux@1; token %aux_7_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_5_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_3_w) #toOffset(Unsupported); | ||
| 5 | + continue %aux_5@1, %aux_5_w; | ||
| 6 | + } | ||
| 7 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_7_r = !10002 ADDS(%aux_7@1) token(%aux_7_w_for); | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %out_1_w, token %$0_r = !10003 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 9 | + return %src@0, %aux_7@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w, token %aux_3_r = !10002 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 5 | + return %src@0, %aux_3@1, %$0@3; | ||
| 6 | +} | ||
| @@ -0,0 +1,5 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %shape@2 #dtype(float) #shape([-1]) #offset([0]) #dynvalidshape([v0call(RUNTIME_GetInputShapeDim, ARG_shape, 0)])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w, token %src_r = !10000 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w, token %src_r = !10001 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + return %src@0, %aux_3@1, %shape@2; | ||
| 5 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$1_w = !10002 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$1_r = !10003 ASSEMBLE(%$1@4) token(%$1_w, %aux_1_w) #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$2_w, token %a_r, token %aux_3_r = !10004 ADD(%a@0, %aux_3@1) token(%aux_3_w); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$2_r = !10005 ASSEMBLE(%$2@5) token(%$2_w) #toOffset(Unsupported); | ||
| 8 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$1_w, token %aux_1_r = !10002 ADDS(%aux_1@1) token(%aux_1_w); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$2_w = !10003 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$2_r = !10004 ASSEMBLE(%$2@5) token(%$2_w, %aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$3_w, token %$1_r, token %aux_3_r = !10005 ADD(%$1@4, %aux_3@1) token(%$1_w, %aux_3_w); | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$3_r = !10006 ASSEMBLE(%$3@6) token(%$3_w) #toOffset(Unsupported); | ||
| 9 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$1_w = !10002 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$1_r = !10003 ASSEMBLE(%$1@4) token(%$1_w, %aux_1_w) #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$2_w, token %a_r, token %aux_3_r = !10004 ADD(%a@0, %aux_3@1) token(%aux_3_w); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$2_r = !10005 ASSEMBLE(%$2@5) token(%$2_w) #toOffset(Unsupported); | ||
| 8 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,14 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$1_w, token %aux_1_r = !10002 ADDS(%aux_1@1) token(%aux_1_w); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$2_w = !10003 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$2_r = !10004 ASSEMBLE(%$2@5) token(%$2_w, %aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$3_w, token %aux_3_r = !10005 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 8 | + v0_logical_tensor %$4@7 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$4_w = !10006 VEC_DUP() token(); | ||
| 9 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_5_w, token %$4_r = !10007 ASSEMBLE(%$4@7) token(%$4_w, %aux_3_r) #toOffset(Unsupported); | ||
| 10 | + v0_logical_tensor %$5@8 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$5_w, token %$1_r, token %$3_r = !10008 ADD(%$1@4, %$3@6) token(%$1_w, %$3_w); | ||
| 11 | + v0_logical_tensor %$6@9 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$6_w, token %$5_r, token %aux_5_r = !10009 ADD(%$5@8, %aux_5@1) token(%$5_w, %aux_5_w); | ||
| 12 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$6_r = !10010 ASSEMBLE(%$6@9) token(%$6_w) #toOffset(Unsupported); | ||
| 13 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 14 | +} | ||
| @@ -0,0 +1,11 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$1_w = !10002 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$1_r = !10003 ASSEMBLE(%$1@4) token(%$1_w, %aux_1_w) #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$2_w = !10004 VEC_DUP() token(); | ||
| 7 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_5_w, token %$2_r = !10005 ASSEMBLE(%$2@5) token(%$2_w, %aux_3_w) #toOffset(Unsupported); | ||
| 8 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$3_w, token %a_r, token %aux_5_r = !10006 ADD(%a@0, %aux_5@1) token(%aux_5_w); | ||
| 9 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$3_r = !10007 ASSEMBLE(%$3@6) token(%$3_w) #toOffset(Unsupported); | ||
| 10 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 11 | +} | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$0_w = !10000 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w, token %$0_r = !10001 ASSEMBLE(%$0@3) token(%$0_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$1_w, token %aux_1_r = !10002 ADDS(%aux_1@1) token(%aux_1_w); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]), token %$2_w = !10003 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w, token %$2_r = !10004 ASSEMBLE(%$2@5) token(%$2_w, %aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]), token %$3_w = !10005 VEC_DUP() token(); | ||
| 8 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_5_w, token %$3_r = !10006 ASSEMBLE(%$3@6) token(%$3_w, %aux_3_w) #toOffset(Unsupported); | ||
| 9 | + v0_logical_tensor %$4@7 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %$4_w, token %$1_r, token %aux_5_r = !10007 ADD(%$1@4, %aux_5@1) token(%$1_w, %aux_5_w); | ||
| 10 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %out_1_w, token %$4_r = !10008 ASSEMBLE(%$4@7) token(%$4_w) #toOffset(Unsupported); | ||
| 11 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 12 | +} | ||
| @@ -0,0 +1,5 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %x@0 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]), v0_logical_tensor %out@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@2 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10003 ADDS(%x@0) token(); | ||
| 3 | + v0_logical_tensor %out_1@1 #dtype(float) #shape([16, 16]) #offset([0, 0]) #dynvalidshape([16, 16]) = !10004 ASSEMBLE(%$0@2) token() #toOffset(Unsupported); | ||
| 4 | + return %x@0, %out_1@1; | ||
| 5 | +} | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10005 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10006 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10007 ADDS(%aux_3@1) token(%aux_1_w); | ||
| 5 | + return %src@0, %aux_3@1, %$0@3; | ||
| 6 | +} | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10015 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w = !10016 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10017 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10018 ASSEMBLE(%$1@4) token() #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_r = !10019 ADDS(%aux_3@1) token(%aux_1_w); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10020 VEC_DUP() token(); | ||
| 8 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10021 ASSEMBLE(%$3@6) token(%aux_3_r) #toOffset(Unsupported); | ||
| 9 | + v0_logical_tensor %$4@7 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10022 ADD(%$2@5, %aux_5@1) token(); | ||
| 10 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10023 ASSEMBLE(%$4@7) token() #toOffset(Unsupported); | ||
| 11 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 12 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %a_r, token %aux_r = !10009 ADD(%a@0, %aux@1) token(); | ||
| 3 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10010 VEC_DUP() token(); | ||
| 4 | + v0_logical_tensor %a_1@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10011 ASSEMBLE(%$1@4) token(%a_r) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10012 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10013 ASSEMBLE(%$2@5) token(%aux_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10014 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 8 | + return %a_1@0, %aux_1@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10007 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w = !10008 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10009 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10010 ADDS(%aux_5@1) token(%aux_3_w); | ||
| 6 | + return %src@0, %aux_5@1, %$0@3; | ||
| 7 | +} | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src_a@0 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %src_b@1 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %src_c@2 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@4 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10006 ASSEMBLE(%src_a@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w = !10007 ASSEMBLE(%src_b@1) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10008 ASSEMBLE(%src_c@2) token(%aux_1_w) #toOffset(Unsupported); | ||
| 5 | + v0_logical_tensor %$0@5 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10009 ADDS(%aux_5@3) token(%aux_3_w); | ||
| 6 | + return %src_a@0, %src_b@1, %src_c@2, %aux_5@3, %$0@5; | ||
| 7 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10004 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w = !10005 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %value_0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %value_0_w_for = for %loop_idx_21 inrange 0, 2, 1 iter { none %value = %None; token %value_0_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 5 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %$0_w = !10006 ADDS(%aux_3@1) token(%aux_3_w); | ||
| 6 | + continue %$0@3, %$0_w; | ||
| 7 | + } | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10007 ASSEMBLE(%value_0@3) token(%value_0_w_for) #toOffset(Unsupported); | ||
| 9 | + return %src@0, %aux_3@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %out@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_7@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_7_w_for = for %loop_idx_5 inrange 0, 2, 1 iter { v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = %aux@1; token %aux_7_w_for_iter = %None; } #parallel(false) #submit_before_loop(false) #_loop_conds(Unsupported) #_config_scope(Unsupported) #unroll_times(1) { | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_3_w = !10005 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_5_w = !10006 ASSEMBLE(%src@0) token(%aux_3_w) #toOffset(Unsupported); | ||
| 5 | + continue %aux_5@1, %aux_5_w; | ||
| 6 | + } | ||
| 7 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10007 ADDS(%aux_7@1) token(%aux_7_w_for); | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10008 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 9 | + return %src@0, %aux_7@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %result@2 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10004 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10005 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10006 ADDS(%aux_3@1) token(); | ||
| 5 | + return %src@0, %aux_3@1, %$0@3; | ||
| 6 | +} | ||
| @@ -0,0 +1,5 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %src@0 #dtype(float) #shape([8, 16]) #offset([0, 0]) #dynvalidshape([8, 16]), v0_logical_tensor %aux@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), v0_logical_tensor %shape@2 #dtype(float) #shape([-1]) #offset([0]) #dynvalidshape([v0call(RUNTIME_GetInputShapeDim, ARG_shape, 0)])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]), token %aux_1_w = !10002 ASSEMBLE(%src@0) token() #toOffset(Unsupported); | ||
| 3 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([32, 16]) #offset([0, 0]) #dynvalidshape([32, 16]) = !10003 ASSEMBLE(%src@0) token(%aux_1_w) #toOffset(Unsupported); | ||
| 4 | + return %src@0, %aux_3@1, %shape@2; | ||
| 5 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10010 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w = !10011 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10012 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10013 ASSEMBLE(%$1@4) token() #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10014 ADD(%a@0, %aux_3@1) token(%aux_1_w); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10015 ASSEMBLE(%$2@5) token() #toOffset(Unsupported); | ||
| 8 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10012 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10013 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_r = !10014 ADDS(%aux_1@1) token(); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10015 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10016 ASSEMBLE(%$2@5) token(%aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10017 ADD(%$1@4, %aux_3@1) token(); | ||
| 8 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10018 ASSEMBLE(%$3@6) token() #toOffset(Unsupported); | ||
| 9 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 10 | +} | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10010 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w = !10011 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10012 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10013 ASSEMBLE(%$1@4) token(%aux_1_w) #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10014 ADD(%a@0, %aux_3@1) token(); | ||
| 7 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10015 ASSEMBLE(%$2@5) token() #toOffset(Unsupported); | ||
| 8 | + return %a@0, %aux_3@1, %out_1@2; | ||
| 9 | +} | ||
| @@ -0,0 +1,14 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10019 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10020 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_r = !10021 ADDS(%aux_1@1) token(); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10022 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10023 ASSEMBLE(%$2@5) token(%aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_r = !10024 ADDS(%aux_3@1) token(); | ||
| 8 | + v0_logical_tensor %$4@7 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10025 VEC_DUP() token(); | ||
| 9 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10026 ASSEMBLE(%$4@7) token(%aux_3_r) #toOffset(Unsupported); | ||
| 10 | + v0_logical_tensor %$5@8 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10027 ADD(%$1@4, %$3@6) token(); | ||
| 11 | + v0_logical_tensor %$6@9 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10028 ADD(%$5@8, %aux_5@1) token(); | ||
| 12 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10029 ASSEMBLE(%$6@9) token() #toOffset(Unsupported); | ||
| 13 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 14 | +} | ||
| @@ -0,0 +1,11 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10013 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_w = !10014 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10015 VEC_DUP() token(); | ||
| 5 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w = !10016 ASSEMBLE(%$1@4) token() #toOffset(Unsupported); | ||
| 6 | + v0_logical_tensor %$2@5 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10017 VEC_DUP() token(); | ||
| 7 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10018 ASSEMBLE(%$2@5) token(%aux_1_w) #toOffset(Unsupported); | ||
| 8 | + v0_logical_tensor %$3@6 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10019 ADD(%a@0, %aux_5@1) token(%aux_3_w); | ||
| 9 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10020 ASSEMBLE(%$3@6) token() #toOffset(Unsupported); | ||
| 10 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 11 | +} | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +function foo incast(v0_logical_tensor %a@0 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %aux@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), v0_logical_tensor %out@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128])) outcast() #type(Opaque) #entry(false) { | ||
| 2 | + v0_logical_tensor %$0@3 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10015 VEC_DUP() token(); | ||
| 3 | + v0_logical_tensor %aux_1@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10016 ASSEMBLE(%$0@3) token() #toOffset(Unsupported); | ||
| 4 | + v0_logical_tensor %$1@4 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_1_r = !10017 ADDS(%aux_1@1) token(); | ||
| 5 | + v0_logical_tensor %$2@5 #dtype(float) #shape([32, 128]) #offset([0, 0]) #dynvalidshape([32, 128]) = !10018 VEC_DUP() token(); | ||
| 6 | + v0_logical_tensor %aux_3@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]), token %aux_3_w = !10019 ASSEMBLE(%$2@5) token(%aux_1_r) #toOffset(Unsupported); | ||
| 7 | + v0_logical_tensor %$3@6 #dtype(float) #shape([64, 128]) #offset([0, 0]) #dynvalidshape([64, 128]) = !10020 VEC_DUP() token(); | ||
| 8 | + v0_logical_tensor %aux_5@1 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10021 ASSEMBLE(%$3@6) token(%aux_1_r) #toOffset(Unsupported); | ||
| 9 | + v0_logical_tensor %$4@7 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10022 ADD(%$1@4, %aux_5@1) token(%aux_3_w); | ||
| 10 | + v0_logical_tensor %out_1@2 #dtype(float) #shape([129, 128]) #offset([0, 0]) #dynvalidshape([129, 128]) = !10023 ASSEMBLE(%$4@7) token() #toOffset(Unsupported); | ||
| 11 | + return %a@0, %aux_5@1, %out_1@2; | ||
| 12 | +} | ||