VainF / Torch-Pruning

[CVPR 2023] Towards Any Structural Pruning; LLMs / SAM / Diffusion / Transformers / YOLOv8 / CNNs
https://arxiv.org/abs/2301.12900
MIT License
2.44k stars 308 forks source link

Fix split pruning for multiple iterative_steps #352

Open SPieterG opened 3 months ago

SPieterG commented 3 months ago

The SplitPruner updates self.offsets instead of layer.offsets causing index errors when using iterative_steps > 1

Reproducible by setting iterative_steps=2 in the test_concat_split.py and test_split.py tests

SPieterG commented 3 months ago

@VainF Looking at the ConcatPruner it seems to do the same with self.offsets but the test_concat.py already works even with iterative_steps = 5. Would you know what could be the difference that makes concat work but split fail or would it be failing in a hidden way?