-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Silence deprecations and use the DataLoaderConfig #29779
Conversation
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.
Thank you @muellerzr for refactoring the code to account for the deprecations, LGTM! 🧹✨
if is_accelerate_available("0.28.0"): | ||
dataloader_config = DataLoaderConfiguration( | ||
split_batches=accelerator_config.pop("split_batches"), | ||
dispatch_batches=accelerator_config.pop("dispatch_batches"), | ||
even_batches=accelerator_config.pop("even_batches"), | ||
use_seedable_sampler=accelerator_config.pop("use_seedable_sampler"), | ||
) | ||
args = { | ||
"deepspeed_plugin": self.args.deepspeed_plugin, | ||
"gradient_accumulation_plugin": gradient_accumulation_plugin, | ||
} | ||
if is_accelerate_available("0.28.0"): | ||
args["dataloader_config"] = dataloader_config | ||
else: | ||
args.update(accelerator_config) |
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.
This design method allows us to be prepared for future versions of accelerator_config
where we might want to add more values that don't directly relate to the DataLoaderConfiguration
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Thanks for adding this so quickly! 🔥
What does this PR do?
Now that accelerate v0.28.0 is out, removes the super annoying future warnings and opts to use the
DataLoaderConfig
Follow up to #28664
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@pacman100 @amyeroberts