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

Instantiate optimizer in compile only mode #292

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

kundaMwiza
Copy link
Contributor

@kundaMwiza kundaMwiza commented Mar 22, 2023

What does this PR do?

if the user does not provide an optimizer to the trainer class, self.optimizer=None with compile only mode. This is okay for Trainer.train() since it makes the call to self.create_optimizer(), which instantiates an optimizer if one does not exist. This PR ensures that an optimizer is instantiated even in compile only mode.

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

…le only mode. self.train() will eventually make the call to self.create_optimizer()
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 22, 2023

The documentation is not available anymore as the PR was closed or merged.

@kundaMwiza kundaMwiza changed the title Make sure an optimizer is instantiated in compile only mode Instantiate optimizer in compile only mode Mar 22, 2023
@jimypbr jimypbr merged commit 0a9418d into huggingface:main Mar 22, 2023
@jimypbr jimypbr deleted the compile-only-fix branch March 22, 2023 15:56
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