loop_order_greedy
connected_loop_candidates(prefix, remaining, conjunct_stats, disjunct_stats)
All fields still available for the next loop index.
Source code in src/finch/autoschedule/loop_orderer/loop_order_greedy.py
32 33 34 35 36 37 38 39 | |
greedy_loop_order(expr, stats_factory, stats_bindings, output_vars=None)
Build a loop order one index at a time, appending the cheapest candidate.
Each step is scored with the same terms loop_order_cost charges for that
prefix -- get_prefix_cost for the reads and writes, plus the reformats
the new index forces -- so the summed score of the returned order equals its
loop_order_cost.
Source code in src/finch/autoschedule/loop_orderer/loop_order_greedy.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
transpose_penalty(input_stats, prefix, charged)
Cost of the reformats that prefix newly forces.
needs_reformat is monotone in the prefix: an index placed before one
that precedes it in a tensor's storage order already forces that tensor to
be reformatted, and extending the prefix cannot undo it. So each tensor is
charged exactly once, at the step where its reformat becomes unavoidable,
and the total over a full order matches loop_order_cost.
Source code in src/finch/autoschedule/loop_orderer/loop_order_greedy.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |