-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Safely end training even if trackers weren't initialized #1994
Conversation
I wonder if the better solution wouldn't be to set |
@BenjaminBossan i totally agree, and in fact wrote that first, but I thought there was likely a good reason why that wasn't done in the first place. It's uncommon not to initialize all member variables on Do you think I should go ahead with that? |
You make a good point that there could be a non-obvious reason. If it's okay to you, we could wait for Zach to comment on this (which may take a week or so). |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
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.
Agree with what's being said here. We should set it to []
initially (and honestly shocked we didn't!) and then just keep the original logic :) Would you be willing to do that? Great catch :)
Hi @muellerzr updated! I missed your message, sorry about that |
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 the fix! :)
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.
@Ben-Epstein would you like to do Benjamin's comments in this PR? Or can I go with a follow-up PR with it :) |
Hey thanks @BenjaminBossan -- the first (removing self.trackers in |
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.
Great, LGTM, thanks for addressing the remaining points.
What does this PR do?
If you create an instance of
Accelerator()
without logging to a tracker, and then callend_training
(which would be common in development/debugging), the accelerator shouldn't crash if there aren't trackers. Sinceself.trackers
isn't initialized in the__init__
of the class, this is possibleBefore submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Tested by running the following
Made sure this wasn't thrown
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.