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

[Callbacks] Remove MagnitudePruningModifier.leave_enabled #1198

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

kylesayrs
Copy link
Collaborator

@kylesayrs kylesayrs commented Feb 26, 2025

Purpose

  • Simplify the modifier lifecycle by removing the ability for modifiers to affect the model after the modifier's end event
  • This allows the on_event method to be removed in a future change

Background

  • The leave_enabled option was originally intended as a shortcut to simplify recipes which used magnitude pruning during the iterative pruning, then needed the masks to stay enabled during stabilization SFT
    • This change proposes making the recipe clearer by requiring the ConstantPruningModifier after the MagnitudePruningModifier becomes inactive

Changes

  • Remove MagnitudePruningModifier.leave_enabled with a deprecation warning

Signed-off-by: Kyle Sayers <[email protected]>
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@kylesayrs kylesayrs changed the title Remove MagnitudePruningModifier.leave_enabled [Callbacks] Remove MagnitudePruningModifier.leave_enabled Feb 26, 2025
@kylesayrs kylesayrs self-assigned this Feb 26, 2025
Copy link
Collaborator

@rahul-tuli rahul-tuli left a comment

Choose a reason for hiding this comment

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

Thank you for this change!

@kylesayrs kylesayrs enabled auto-merge (squash) March 7, 2025 18:22
@kylesayrs kylesayrs merged commit 2a59554 into main Mar 7, 2025
8 checks passed
@kylesayrs kylesayrs deleted the kylesayrs/remove-leave_enabled branch March 7, 2025 18:23
brian-dellabetta pushed a commit that referenced this pull request Mar 10, 2025
## Purpose ##
* Simplify the modifier lifecycle by removing the ability for modifiers
to affect the model after the modifier's `end` event
* This allows the `on_event` method to be removed in a future change

## Background ##
* The `leave_enabled` option was originally intended as a shortcut to
simplify recipes which used magnitude pruning during the iterative
pruning, then needed the masks to stay enabled during stabilization SFT
* This change proposes making the recipe clearer by requiring the
ConstantPruningModifier after the MagnitudePruningModifier becomes
inactive

## Changes ##
* Remove `MagnitudePruningModifier.leave_enabled` with a deprecation
warning

Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Brian Dellabetta <[email protected]>
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.

3 participants