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

fix executable batch size issue #24067

Merged
merged 3 commits into from Jun 7, 2023

Conversation

pacman100
Copy link
Contributor

@pacman100 pacman100 commented Jun 7, 2023

What does this PR do?

  1. Fixes RuntimeError: unscale_() has already been called on this optimizer since the last update(). #24050
  2. Context: We weren't handling properly the auto_find_batch_size=True case. Here, we need to free all of the stored model references in the Accelerator each time as mentioned in the https://github.com/huggingface/accelerate/blob/main/examples/by_feature/automatic_gradient_accumulation.py
  3. This PR does that.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 7, 2023

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

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Copy link
Contributor

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Thanks!

@pacman100 pacman100 merged commit 12298cb into main Jun 7, 2023
22 checks passed
@pacman100 pacman100 deleted the smangrul/fix-auto-batch-finder-trainer-issue branch June 7, 2023 16:38
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* fix executable batch size issue

* fix

* undo
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.

RuntimeError: unscale_() has already been called on this optimizer since the last update().
4 participants