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 transformers sync bug with accumulate #1624

Merged
merged 4 commits into from
Jun 22, 2023
Merged

Fix transformers sync bug with accumulate #1624

merged 4 commits into from
Jun 22, 2023

Conversation

muellerzr
Copy link
Collaborator

Adds a new sync_with_dataloader arg to the GradientAccumulationPlugin, to assist with using it across epochs via total_batched_samples (huggingface/transformers#23935 (comment))

@muellerzr muellerzr requested a review from pacman100 June 21, 2023 14:47
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 21, 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.

SGTM!

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you Zach for helping with the issue. I've left a comment

src/accelerate/accelerator.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you @muellerzr for adding this! 🤗

@sumpster
Copy link

sumpster commented Jun 21, 2023

Fixed the problem for me.
I was running into crashes at epoch boundaries before and installing this pr plus the matching transformers pr (huggingface/transformers#24405) did the trick.
@muellerzr Thx.

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