nncf
nncf copied to clipboard
set ignored scope widely
Changes
set ignored_scope as op_addresses_to_skip too
Reason for changes
pruning consistently tried to apply to ignored scope
Related tickets
Tests
Guys, looks like we were removed from nncf developers group. Please add me as an reviewer and don't merge this without our review!
Please run precommit tests before merge
cc: @negvet
Guys, looks like we were removed from nncf developers group. Please add me as an reviewer and don't merge this without our review!
cc: @negved
Please request to join at this link: https://github.com/orgs/openvinotoolkit/teams/nncf_pytorch-maintainers/members
Guys, looks like we were removed from nncf developers group. Please add me as an reviewer and don't merge this without our review! cc: @negved
Please request to join at this link: https://github.com/orgs/openvinotoolkit/teams/nncf_pytorch-maintainers/members
cc: @negvet
@sooahleex, please provide an example of network with concat layer as a leaf. Looks like a problem in graph building part.
@sooahleex, we already have mechanism for ignoring layers, it's implemented here: https://github.com/openvinotoolkit/nncf/blob/160990cba0473452955c494b2087c4f4160241c7/nncf/common/pruning/node_selector.py#L279-L305
it used at the last step of node selection here: https://github.com/openvinotoolkit/nncf/blob/160990cba0473452955c494b2087c4f4160241c7/nncf/common/pruning/node_selector.py#L218
It's essential to generate masks for each target node even if it's in a ignored scope because of the algorithm implementation. Ignoring layers during mask propagation could lead to inconsistent pruning layout!
@sooahleex, we already have mechanism for ignoring layers, it's implemented here:
https://github.com/openvinotoolkit/nncf/blob/160990cba0473452955c494b2087c4f4160241c7/nncf/common/pruning/node_selector.py#L279-L305
it used at the last step of node selection here:
https://github.com/openvinotoolkit/nncf/blob/160990cba0473452955c494b2087c4f4160241c7/nncf/common/pruning/node_selector.py#L218
It's essential to generate masks for each target node even if it's in a ignored scope because of the algorithm implementation. Ignoring layers during mask propagation could lead to inconsistent pruning layout!
I knew that part and I checked that works out for mask propagation. When I tried to do pruning, the error is occurred in count_flops_and_weights_per_node
for the layer which I added in ignored scopes. For the function count_flops_and_weights_per_node
, There is no part to check whether it is prunable. So I added op_addresses_to_skip
to check whether the layer is prunable or not.