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

Add ComposedPress and compress method #29

Merged
merged 8 commits into from
Dec 10, 2024
Merged

Add ComposedPress and compress method #29

merged 8 commits into from
Dec 10, 2024

Conversation

SimJeg
Copy link
Collaborator

@SimJeg SimJeg commented Dec 9, 2024

ComposedPress generalizes the idea of composing presses that has been originally introduced in ThinKPress only. It allows chaining multiple presses together. For instance,

press = ThinkPress(0.5, inner_press=SnapKVPress(0.5))

becomes

press = ComposedPress([SnapKVPress(0.5), ThinkPress(0.5)])

The compression ratio is automatically updated anticipating the future refacto in #21

@SimJeg SimJeg changed the title Add ComposedPress Add ComposedPress and compress method Dec 10, 2024
@maxjeblick maxjeblick self-requested a review December 10, 2024 14:54
Copy link
Collaborator

@maxjeblick maxjeblick left a comment

Choose a reason for hiding this comment

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

Refactor LGTM, I left one comment for self.compression_ratio computation.

Copy link
Collaborator

@maxjeblick maxjeblick left a comment

Choose a reason for hiding this comment

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

LGTM!

@SimJeg SimJeg merged commit 715f8a7 into main Dec 10, 2024
2 checks passed
@SimJeg SimJeg deleted the simon/composedpress branch December 10, 2024 16:25
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