Skip to content

Conversation

AlexanderDokuchaev
Copy link
Collaborator

@AlexanderDokuchaev AlexanderDokuchaev commented Oct 15, 2025

Changes

Add rb pruning algorithm
Rename prune folder to pruning
Add parameters to select pruning mode in example

Related tickets

173791

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 22, 2025
@AlexanderDokuchaev AlexanderDokuchaev marked this pull request as ready for review October 22, 2025 09:15
@AlexanderDokuchaev AlexanderDokuchaev requested a review from a team as a code owner October 22, 2025 09:15
```bash
python main.py
# Or to run Regularization-Based pruning
python main.py --mode rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the documentation about sparsity is not connected with this sample and contains old configs.
are you going to update in the next PRs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,



@COMPRESSION_MODULES.register()
class RBPruningMask(nn.Module, StatefulModuleInterface):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to save and load pruned model? Is there test for such functionality?

Comment on lines +56 to +62
assert r == 0.5061728358268738
scheduler.step()
r = float(1 - mask.sum() / 81)
assert r == 0.1111111044883728
scheduler.step()
r = float(1 - mask.sum() / 81)
assert r == 0.48148149251937866
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the ratio monotonously grow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's exponential scheduler

@ljaljushkin
Copy link
Contributor

Overall looks good and functional.

I've run the sample and checked actual sparsity in IR .bin file. It's around 68%
image

Current pruning ratio: 0.689
Accuracy@1 of pruned model after 29 epoch: 54.870

@ljaljushkin
Copy link
Contributor

sample has some unused imports. formatting of samples is not part of make-precommit routine, is it?

@AlexanderDokuchaev
Copy link
Collaborator Author

sample has some unused imports. formatting of samples is not part of make-precommit routine, is it?

no, it's works
technically imports used, but it's not need, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants