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

Properly restore training mode with eval_context #1126

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Conversation

kylesayrs
Copy link
Collaborator

Purpose

  • Remove side effect of leaving a model in eval mode when calibrating

Changes

  • Use eval_context, which stores the original training state of the model
  • Fix some type hints

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

github-actions bot commented Feb 5, 2025

👋 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 added the ready When a PR is ready for review label Feb 5, 2025
@kylesayrs kylesayrs self-assigned this Feb 5, 2025
Copy link
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

cool! one question but good to merge after sanity checking

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

horheynm commented Feb 7, 2025

In general is there a bug or feature that this pr is fixing? Whats the problem we have now to include this feature?

@kylesayrs
Copy link
Collaborator Author

@horheynm I cannot point to specific issue which is caused by not restoring the training mode, but we're moving towards LLM Compressor being used in downstream training scripts, so it's good to harden out these side effects early before we encounter issues caused by them later.

@dsikka dsikka merged commit 85c1fc5 into main Feb 7, 2025
7 checks passed
@dsikka dsikka deleted the kylesayrs/eval_context branch February 7, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready When a PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants