util
desugar_query_into(root)
¶
Replace each in-place QueryInto with the equivalent Query, which reads
the previous value of its left-hand side explicitly.
Source code in src/finch/autoschedule/util.py
drop_query_reorders(root)
¶
Remove a Reorder at the root of each query's right-hand side. The table on the left-hand side of a query already fixes the order of its result.
Source code in src/finch/autoschedule/util.py
push_relabels(root)
¶
Push each Relabel down to the Tables and scalars it relabels.
Source code in src/finch/autoschedule/util.py
reorder_to(ex, idxs)
¶
resugar_query_into(root)
¶
Replace each query of an aggregate which starts from a tensor with an
in-place QueryInto. The aggregate folds its argument into a copy of its
init, so the copy is skipped when the init is the table being written.
Inits which are broadcast over the output can't be copied into it, so they
are left as they are.
Source code in src/finch/autoschedule/util.py
split_aggregate_inits(root, bindings, broadcast_only=False)
¶
Replace each aggregate which starts from a tensor with a map of that tensor
and a reduction which starts from the identity of the aggregate's operator.
With broadcast_only, only the inits which are broadcast over some fields
of the aggregate are split.
Source code in src/finch/autoschedule/util.py
write_protocols(idxs, loop_order, nfused=0)
¶
The protocol which a query under loop_order writes each stored level of a table of idxs with, whose first nfused fields are fused. A level is reached at the last loop over a field of the levels from the root to it. Where the loops up to it are those fields in storage order, each index of the level is written once, in order, so it's extruded, and otherwise it's laminated.