fixup concats for grouped convolution #1811
Open
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.
The function "fixup_concats" in file "apex\contrib\sparsity\permutation_lib.py " does not take grouped convolution into account, it will get a wrong "sibling_group_C_params" for a node which is grouped convolution or which has grouped convolution siblings. So this pull request adds a line code to deal with this issue.
Here i will explained the issue in detail,
As shown in above figure, node A and B are siblings, we assume their sibling_group_C_params is 16. And P1 and P2's output channels are 32. When the ASP does "fixup_concats" for node A, it may get children_GCD_param 32, then node A and node B's sibling_group_C_params will be update to 32. When the ASP does permutation for node B, the exception "AssertionError: sibling B's weights' C=16 must be even multiple of the sibling group's C parameter 32" will be raised.