Skip to content

Conversation

@mdanilow
Copy link

@mdanilow mdanilow commented Sep 5, 2024

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 should be considered deprecated
  • Some transformations (MoveScalarLinearPastInvariants, MakeMaxPoolNHWC, MakeScaleResizeNHWC) are fixed to check whether the node to be moved is a fork node, in which case the MoveOpPastFork would be called
  • The MoveOpPastFork() transformation is more flexible because it uses deepcopies of an original node (the get_attrs_fxn parameter is not needed anymore)
  • 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.
  • MoveAffinePastJoinConcat() transformation can be used for both scalar and channelwise affine operations.
  • test_move_identical_op_past_join_op.py is 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

Michal added 2 commits September 5, 2024 14:10
return (model, graph_modified)


class MoveLinearPastEltwiseAdd(Transformation):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new transformations replace this one, it can be deleted.

@mdanilow mdanilow closed this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants