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.
Changes
I double checked the test and found that there is a bug in the original filter pruning test. Maybe this case can let Nikolay want to merge our PR. Thanks!
Reason for changes
The old function cannot deal with the following test case
MobilenetV3BlockSEReshape
:Here is part of the original graph of MobilenetV3BlockSEReshape:
For test case
MobilenetV3BlockSEReshape
, here is the result oftmp_out_channels
andtmp_in_channels
using the function in public NNCF: (tmp_out_channels
andtmp_in_channels
are generated here):We can see node
MobilenetV3BlockSEReshape/InvertedResidual[inverted_residual]/Sequential[conv]/NNCFConv2d[4]/conv2d_0: 6
in tmp_in_channels, which is incorrect.This is because node
MobilenetV3BlockSEReshape/InvertedResidual[inverted_residual]/Sequential[conv]/NNCFConv2d[4]/conv2d_0
is in clusters(not in next_nodes) and it is not a depthwise conv, so its input channel doesn't minus pruned elements.Our PR can deal with this test case. If use our PR,
MobilenetV3BlockSEReshape/InvertedResidual[inverted_residual]/Sequential[conv]/NNCFConv2d[4]/conv2d_0: 1
in tmp_in_channelsRelated tickets
N/A
Tests
N/A