loop_ordering
AbstractLoopOrderer
¶
Bases: LogicLoopOrderer
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
set_loop_orders(prgm, stats, stats_factory)
abstractmethod
¶
prgm, with the loop order of each query set, priced from the stats of the tensors it reads alone, whatever their formats, as galloping does, since the workspacer may copy its inputs into any format.
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
concordize(root, bindings)
¶
Read every Table of a query in the loop order of its enclosing Fuse nodes. A Table stored in another order reads a transposed copy of its tensor instead, which is made after each statement that writes the tensor. Copies may read their argument in any order.
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
drop_internal_reorders(root)
¶
Remove the Reorders within the right-hand side of each aggregate query and in-place update, whose fields are ordered by their left-hand tables.
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
galloping(expr)
¶
expr, with every table galloping over each field it stores. The workspacer may copy an input into any format, so the loops are priced from the stats of the tables alone, as if every table galloped: a loop visits where every table it merges has entries, and looks each up there.
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
with_copy_loop_orders(root)
¶
Set the loop order of each copy, which visits the fields of its argument in the order it stores them, and then the fields only its left-hand table has. A transposing copy reads its argument in order and scatters into its left-hand table, rather than reading a sparse argument out of order.
Source code in src/finch/autoschedule/loop_orderer/loop_ordering.py
with_loop_order(stmt, loop_order)
¶
Set the loop order of an aggregate query or in-place update by wrapping it in a Fuse node for each field of the loop order, followed by the fields which only the table it writes has, such as output-only unit dimensions. The loop order may visit the fields of that table out of the order it stores them in, in which case the query scatters into the table.