Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Allow GradientAccumulationPlugin to be configured from AcceleratorConfig #29589
Allow GradientAccumulationPlugin to be configured from AcceleratorConfig #29589
Changes from 4 commits
4cb501d
3d1a3d5
2161e07
1860ab5
b021316
3d1f632
796a910
ff7e171
c8a0a86
968d415
4c579dc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this logic, let's just use
@require_accelerate(min_version="0.28.0")
on the tests that need itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muellerzr sorry can I clarify this remark?
GRAD_ACCUM_KWARGS_VERSION_AVAILABLE
and useis_accelerate_available("0.28")
directly in the conditional?partial
bind and directly decorate the test as@is_accelerate_available("0.28")
? If so, then I do not think we can follow therequire_fsdp
function style. Will need to rewrirerequire_accelerate
into a "builder"But the issue with this is the null pattern
@require_accelerate
doesnt work anymore, we need to instead write@require_accelerate()
, i.e., with the extra()
brackets.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just mimic what's done in
test_fsdp.py
, make the partial decorator in the test file:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you can then just use
@require_fsdp_version
on the testThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes what the test does. Let's not do this please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agree, in this case I would think its best to revert this test to its previous state and not introduce
gradient_accumulation_kwargs
at all in this particular test.Since
gradient_accumulation_kwargs
being specified is already non-default, then we have a host of other tests that consider this.Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup