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.
![image](https://private-user-images.githubusercontent.com/82649220/341736377-ab057e39-e04d-4762-b84d-7e1776c89f7c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzkwMDksIm5iZiI6MTczOTAzODcwOSwicGF0aCI6Ii84MjY0OTIyMC8zNDE3MzYzNzctYWIwNTdlMzktZTA0ZC00NzYyLWI4NGQtN2UxNzc2Yzg5ZjdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE4MTgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkYzE1ODA5Y2RlZWI3OGYwZDJmNjJlNjVlZmQxOGUyNDY0ZTVmODIzMzQ1OTk4ODVkMTUwODFmNzg4ZGEwNTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LtDBuyo6ScA9vZmUdblkexas6X1Lupo9GhHUvxATyTA)
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.