Pruning support for chunk ops
Changes
- Add layer attribute and functions for chunk/split ops
- mask propagation for split/chunk ops
Reason for changes
- To support pruning for chunk operation in HRNet
- Support both split and chunk operation
Related tickets
86694
Tests
TODO
@daniil-lyakhov This is the draft version
@sooahleex, thank you for your contribution!
Please don't forget to update correspondent nncf tensorflow part as well
Please add tests to torch/pruning/filter_pruning/test_algo.py
Please add tests to torch/pruning/filter_pruning/test_algo.py
@daniil-lyakhov I added more cases for split/chunk models in tests/torch/pruning/helpers.py.
ex.

run pytorch pre-commit tests
General comment:
Masks matching by input shapes is implicit method of matching, I suggest you to
- Explicitly have SymbolicMask (in case op has one ouput edge) or {Nodename: SymbolicMask} (in case op has several output edges) as value kept in node.data['output_mask']
- Use
get_input_maskseverywhere to get input masks for node resolving all dependencies inside this util function
I wonder how the algorithm will work when chunk axis doesn't match channel axis, according to which pruning occurs. What will happen with pruning mask and propagation algorithm? I think it makes sense to cover in tests.
@sooahleex, to test this please update test_model_pruning_analysis.py with model/models which have split operations described in previous comment
I fix the error which occurred due to PR.
@ljaljushkin I added the axis=-1 case through SplitModel in tests/torch/pruning/helpers.py. Also, in this case, axis will not be set as -1 but be 3. It is the same logic of the axis setting in the concat method. If you think the current model is not enough, please let me know how to check it more.
run pytorch pre-commit tests
I added the case of Split->Reshape model and Identity split case as corner cases.
Split->Reshape model
Identity Split model

We will cover the reshape check in the different pr related to 90584 ticket. For that ticket and pr, some tests in this pr will be updated for _is_not_mixing_dim.
We will cover the reshape check in the different pr related to 90584 ticket. For that ticket and pr, some tests in this pr will be updated for
_is_not_mixing_dim.
Related to 90976 ticket, the 90584 ticket is not related to this PR
Have started sota eval (torch 56 and tf 87) jobs from nightly validation to make sure it doesn't break anything.
sota eval tf 89 jobs for nightly validation passed.
@ljaljushkin, can we merge it?
@ljaljushkin, can we merge it?
SOTA eval for TF and PT is OK, except some known issues that are not related to the PR. Unfortunately, pre-commit for Pytorch is red due to some infrastructure issue. I'd not merge until we make sure it's passing.
run pytorch pre-commit tests
Pre-commit for PyTorch is not working due to infra issue. We've reported it to CI team. Have to wait until it's fixed and green
run pytorch pre-commit tests