-
Notifications
You must be signed in to change notification settings - Fork 970
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 backend check #2670
fix backend check #2670
Conversation
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! This looks a bit better on paper at least, I'll pull it down and test locally before giving the ✅
Left a few logic and style nits
src/accelerate/state.py
Outdated
original_backend = kwargs.pop("backend", None) | ||
backend, distributed_type = self._prepare_backend(cpu, use_sagemaker_dp, original_backend) | ||
if original_backend and backend != original_backend: | ||
logger.warning(f"The assigned backend is {original_backend}, but the real backend is {backend}") |
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.
I don't think it makes sense to do a warning here. This should be a raise
if this is truly a situation we can get into.
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.
Done
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.
I don't see this change propagated?
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.
Sorry, I forgot to push. It should be updated now, pls check. Thx.
Co-authored-by: Zach Mueller <muellerzr@gmail.com>
Co-authored-by: Zach Mueller <muellerzr@gmail.com>
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 so much! One last, last thing then we can merge and get a patch out ✅
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 fixing!
Co-authored-by: Zach Mueller <muellerzr@gmail.com>
* fix backend check * reformat backend check * Update src/accelerate/state.py Co-authored-by: Zach Mueller <muellerzr@gmail.com> * Update src/accelerate/state.py Co-authored-by: Zach Mueller <muellerzr@gmail.com> * raise value error if backend mismatch * Update src/accelerate/state.py Co-authored-by: Zach Mueller <muellerzr@gmail.com> --------- Co-authored-by: Zach Mueller <muellerzr@gmail.com>
Hi @muellerzr
Related to #2652 . I think we'd better have a test on it.
I think the best way is to have an end-to-end test in the CI; it will avoid most issues : )