-
Notifications
You must be signed in to change notification settings - Fork 3.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
[TPU] For XLA Strategy, added function arg to control broadcast_master_param()
#17522
Conversation
Added function argument to XLA strategy controlling whether to call broadcast_master_params(). Broadcasting master parameters is not always needed. For example, when initializing random weights, if the seed is defined and the same on all devices, then broadcast_master_params() is not needed.
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 added a test for the Fabric XLAStrategy. |
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.
LGTM! Last bit is to add a CHANGELOG entry for both Fabric and PyTorch
for more information, see https://pre-commit.ci
broadcast_master_params()
broadcast_master_param()
What does this PR do?
Adds boolean
sync_module_states
toXLAStrategy
to control whether or not to callbroadcast_master_params()
. Broadcasting master parameters is not always needed. For example, when initializing random weights, if the seed is defined and the same on all devices, then broadcast_master_params() is not needed.The motivation for this change is that
broadcast_master_params()
adds additional time to training and if not needed should be skipped.Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist