You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, given a decapode like: * -f-> * -g-> * -h-> *, where each arrow f,g,h multiplies by a matrix A,B,C, respectively, the generated function will perform three matrix-vector multiplications.
We would like to pre-multiply these matrices into D=CBA, so the generated function will perform only one matrix-vector multiplication.
A working example of this optimization should focus on editing the combinatorial data structure of the decapode. This will require a function that is the inverse of expand_operators.
The text was updated successfully, but these errors were encountered:
We note that we can take this idea of contracting chains further by eliminating branches.
In other words, a binary tree of depth 2, (with update steps at the leaves) requires (assuming all functions on edges are unique) 6 matrices, 2 intermediary vectors, and performs 6 matrix-vector multiplications. This could be re-written as an equivalent 1-deep 4-ary tree which requires just 4 matrices, 0 intermediary vectors, and performs 4 matrix-vector multiplications. This result cannot be improved upon, unless edge pruning of duplicate operations is performed.
This speed-up and memory improvement of an entire decapode in this fashion is unlikely to occur, since Op2s are likely to break this downwards tree-like property.
Currently, given a decapode like:
* -f-> * -g-> * -h-> *
, where each arrowf,g,h
multiplies by a matrixA,B,C
, respectively, the generated function will perform three matrix-vector multiplications.We would like to pre-multiply these matrices into
D=CBA
, so the generated function will perform only one matrix-vector multiplication.A working example of this optimization should focus on editing the combinatorial data structure of the decapode. This will require a function that is the inverse of
expand_operators
.The text was updated successfully, but these errors were encountered: