Skip to content

Refactor press-scorer#24

Merged
maxjeblick merged 52 commits intomainfrom
max/refactor_press
Dec 10, 2024
Merged

Refactor press-scorer#24
maxjeblick merged 52 commits intomainfrom
max/refactor_press

Conversation

@maxjeblick
Copy link
Copy Markdown
Collaborator

This PR refactors the current press class as described in detail in #21.

  • Most presses are now composed of a scorer-pruner combination, e.g. DefaultPruner(compression_ratio=compression_ratio, scorer=KnormScorer()).
  • Presses are flexible and don't need to have compression_ratio, see e.g. PerLayerCompressionPruner.
  • Another example of flexibility is ThinKPress that implements channel compression.

Note: As the Pr is already quite large, I didn't add more refactoring, as suggested in the comment of #21. These helpful changes can be added in a subsequent PR.

Closes #21

@maxjeblick maxjeblick requested a review from SimJeg December 4, 2024 09:54
Comment thread kvpress/prunners/default_pruner.py
Comment thread evaluation/evaluate.py
Comment thread kvpress/presses/per_layer_compression_press.py Outdated
@maxjeblick maxjeblick merged commit 9ecd556 into main Dec 10, 2024
@maxjeblick maxjeblick deleted the max/refactor_press branch December 10, 2024 13:49
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.

Refactor press implementation

2 participants