Skip to content

[WIP] Oneshot Callbacks #1244

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

Closed
wants to merge 7 commits into from
Closed

[WIP] Oneshot Callbacks #1244

wants to merge 7 commits into from

Conversation

kylesayrs
Copy link
Collaborator

@kylesayrs kylesayrs commented Mar 12, 2025

Purpose

  • Standardize oneshot callbacks and prepare for oneshot pipeline extraction

Changes

  • Implement the sequential_epoch_end callback event which should be called after one sequential layer has been calibrated with one epoch
    • Add callback event to sequential and layer_sequential pipelines
  • Trigger module compression both on the SEQUENTIAL_EPOCH_END event as well as on finalize
  • Prepare smoothquant for pipeline extraction
    • Replace uses of _hf_hook. pre_forward with align_module_device for clarity
    • Specify resolved_mappings_ type hint for clarity
    • Trigger _apply_smoothing on the SEQUENTIAL_EPOCH_END as well as on finalize
    • Add a guard which allows the _apply_smoothing function to be called multiple times per session (as is required by sequential pipeline)

Testing

  • Cannot test since cannot call events before initialization

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
Copy link
Collaborator Author

Closing because, due to an initialization check in compression lifecycle, these changes depend on #1279

@kylesayrs kylesayrs closed this Mar 25, 2025
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.

1 participant