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

[Bugfix] Prepare KD Models when Saving #174

Merged
merged 46 commits into from
Oct 7, 2024
Merged

Conversation

kylesayrs
Copy link
Collaborator

@kylesayrs kylesayrs commented Sep 13, 2024

Purpose

  • Fix saving knowledge distillation model checkpoints
  • Fix finetune transformer tests

Prerequisites

Changes

  • Have the session mixin check if the model is a KD model, if so it should prepare all the wrappers to be saved
  • A wrapper which has been prepared acts transparently w.r.t. the named_modules function. The test failures arose because get_state_dict_offloaded_model(model) uses named_modules rather than model.state_dict() to gather all the state dict tensors, and the KD wrapper did not account for this use case.

Testing

  • tests/llmcompressor/transformers/finetune/test_oneshot_then_finetune.py now passes without shared tensor conflicts

Copy link

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

@kylesayrs kylesayrs marked this pull request as draft September 13, 2024 02:16
@kylesayrs kylesayrs changed the title Kylesayrs/pickle checkpoints Structure KD Models when Saving Sep 23, 2024
@kylesayrs kylesayrs changed the title Structure KD Models when Saving Prepare KD Models when Saving Sep 23, 2024
@kylesayrs kylesayrs changed the title Prepare KD Models when Saving [bugfix] Prepare KD Models when Saving Sep 23, 2024
@kylesayrs kylesayrs changed the base branch from main to kylesayrs/fix-offloaded-saving September 25, 2024 18:56
@kylesayrs
Copy link
Collaborator Author

Ready to go, just need to merge prerequisites first

horheynm
horheynm previously approved these changes Sep 26, 2024
@dsikka
Copy link
Collaborator

dsikka commented Sep 27, 2024

Is this ready for review?
In draft mode

@kylesayrs
Copy link
Collaborator Author

@dsikka Yes, ready for review but in draft mode because it should not be merged until the prereqs are merged

rahul-tuli
rahul-tuli previously approved these changes Oct 4, 2024
Base automatically changed from kylesayrs/fix-offloaded-saving to main October 4, 2024 18:14
@mgoin mgoin dismissed stale reviews from rahul-tuli and horheynm October 4, 2024 18:14

The base branch was changed.

@kylesayrs kylesayrs marked this pull request as ready for review October 4, 2024 18:19
@mgoin mgoin merged commit 690e24f into main Oct 7, 2024
5 of 6 checks passed
@mgoin mgoin deleted the kylesayrs/pickle-checkpoints branch October 7, 2024 16:57
markmc pushed a commit to markmc/llm-compressor that referenced this pull request Nov 13, 2024
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.

5 participants