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

Auto grad accum example #742

Merged
merged 3 commits into from
Oct 5, 2022
Merged

Auto grad accum example #742

merged 3 commits into from
Oct 5, 2022

Conversation

muellerzr
Copy link
Collaborator

Showcases how to perform automatic gradient accumulation, similar to a popular feature that was toted by MosaicML awhile back.

The initial batch size starts at 256 to guarantee a CUDA OOM and the user can observe the print statement showing the new number of steps and batch size

@muellerzr muellerzr added the enhancement New feature or request label Oct 5, 2022
@muellerzr muellerzr requested a review from sgugger October 5, 2022 14:24
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

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.

LGTM, thanks a lot!

examples/by_feature/automatic_gradient_accumulation.py Outdated Show resolved Hide resolved
Co-authored-by: Sylvain Gugger <[email protected]>
@muellerzr muellerzr merged commit 5fff81b into main Oct 5, 2022
@muellerzr muellerzr deleted the auto-grad-accum-v2 branch October 5, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants