Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gmp* implemented #15

Merged
merged 2 commits into from
Jul 17, 2024
Merged

gmp* implemented #15

merged 2 commits into from
Jul 17, 2024

Conversation

mklasby
Copy link
Owner

@mklasby mklasby commented Jul 16, 2024

No description provided.

@cemuyuk cemuyuk self-requested a review July 17, 2024 19:06
def _assert_sparsity_level(self, mask: torch.Tensor, sparsity_level: float):
n_ones = mask.sum()
actual_n_ones = int(mask.numel() * (1 - sparsity_level))
if n_ones != actual_n_ones and abs(n_ones - actual_n_ones) > 1:
Copy link
Collaborator

Choose a reason for hiding this comment

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

n_ones != actual_n_ones might be redundant. Unless I'm mistaken abs(n_ones - actual_n_ones) contains the 1st condition.

Copy link
Owner Author

Choose a reason for hiding this comment

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

True, leaving as is for now as the plan will be to rewrite the mask calculators / pruners with sparsity as the target and then hopefully will avoid this off by one error anyways

@cemuyuk
Copy link
Collaborator

cemuyuk commented Jul 17, 2024

Even with the one and only comment above, this seems ready to merge.

@mklasby mklasby merged commit 545e4ab into main Jul 17, 2024
2 checks passed
@mklasby mklasby deleted the gradual-pruning branch July 17, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants