Expand description
The dataflow facts every rule reads, computed once and kept current as ops are absorbed.
The graph being rewritten is a list of slots in program order: each slot an op, or empty once its op is absorbed into
another. Beside it, which live slots read each tensor, write it and compute it whole — updated through every change a
slot takes, since the slots are reached only through these methods. A rule asks the facts instead of scanning the
graph: who computes t, who reads it, whether anything between two slots touches it, and whether moving a slot up
to another would cross a slot that sees the difference.
Structs§
- Slots
- The slots, and the index of what each reads, writes and computes.
Enums§
- Accumulates
- What an op accumulates in integers: nothing, a sum whose operands’ ranges no fact bounds, or every partial result within an interval.
Functions§
- accumulator
- What
opaccumulates in integers, from the rangesgproves of its operands: a matrix product’s running sums over its inner dimension, an elementwise sum or product, a requant’s product before its shift. - product_
sums - The interval every partial sum of
kproducts of operands inaandblies in: the running sums start at zero and each adds one product, every product between the corners’. - reads
- The tensors an op reads: its operands, and the parameters that name the rows its result, or any part’s, lands in.
- result
- The tensor an op computes whole into a buffer of its own, if any.
- writes
- The tensors an op writes: its destination’s buffer, what it writes in place, and what it keeps.