Streamlining transformations for Split and Concat nodes #1189
+908
−480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New transformations in finn/transformation/streamline/reorder.py needed for yolov8 streamlining, some refactoring and generalization of existing transformations included.
The MoveLinearPastEltwiseAdd() is now generalized by a refactored MoveIdenticalOpPastJoinOp and was removed
MoveScalarLinearPastSplit() and MoveTransposePastSplit() transformations added
The MoveIdenticalOpPastJoinOp() transformation is more general and supports moving arbitrary number of identical operations past the join node (instead of just two). This base class checks only the op_types of producers to verify if they are identical. Its are_producers_identical() and move_node() methods should be overwritten by a child class for specific cases of producers and join op. Implemented child classes include: MoveTransposePastJoinAdd, MoveMulPastJoinAdd, MoveAddPastJoinAdd, MoveTransposePastJoinConcat, MoveAffinePastJoinConcat some needed only are_producers_identical() method to be overwritten.
test_move_identical_op_past_join_op.py and test_linear_past_eltwise.py tests are removed and test_move_identical_op_past_join_add.py, test_move_identical_op_past_join_concat.py, test_move_identical_op_past_split.py are added instead