Skip to content

[Callbacks] Remove MagnitudePruningModifier.leave_enabled#1198

Merged
kylesayrs merged 3 commits intomainfrom
kylesayrs/remove-leave_enabled
Mar 7, 2025
Merged

[Callbacks] Remove MagnitudePruningModifier.leave_enabled#1198
kylesayrs merged 3 commits intomainfrom
kylesayrs/remove-leave_enabled

Conversation

@kylesayrs
Copy link
Copy Markdown
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 <kylesayrs@gmail.com>
@github-actions
Copy link
Copy Markdown

👋 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
Copy Markdown
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 <kylesayrs@gmail.com>
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
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