[DDP] Refactor and remove sync_params#64514
Closed
rohan-varma wants to merge 8 commits intogh/rohan-varma/405/basefrom
Closed
[DDP] Refactor and remove sync_params#64514rohan-varma wants to merge 8 commits intogh/rohan-varma/405/basefrom
rohan-varma wants to merge 8 commits intogh/rohan-varma/405/basefrom
Conversation
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) [ghstack-poisoned]
Contributor
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 0eace72 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
This was referenced Sep 5, 2021
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
zhaojuanmao
reviewed
Sep 9, 2021
torch/nn/parallel/distributed.py
Outdated
| @@ -895,7 +895,7 @@ def forward(self, *inputs, **kwargs): | |||
| # specified as part of hook, if hook was specified. | |||
| buffer_hook_registered = hasattr(self, 'buffer_hook') | |||
| if self.require_forward_param_sync and (not buffer_hook_registered or self.buffer_hook.buffer_comm_hook_location == _BufferCommHookLocation.PRE_FORWARD): | |||
Contributor
There was a problem hiding this comment.
nit: put this into a helper function, it could also include 'if self.will_sync_module_buffers()' check in this helper function
Contributor
There was a problem hiding this comment.
e.g., will_sync_module_buffers() can include require_forward_param_sync check; should_sync_buffer_forward(), should_sync_buffer_backward()
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
zhaojuanmao
approved these changes
Sep 20, 2021
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
sync_params is a misnomer since we don't actually synchroniz parameters. While removing this I realized `self._check_and_sync_module_buffers` does almost everything we need it to, so just refactored that and made DDP forward call into it. Differential Revision: [D30751231](https://our.internmc.facebook.com/intern/diff/D30751231/) cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse agolynski @SciPioneer @H-Huang mrzzd cbalioglu gcramer23 [ghstack-poisoned]
Contributor
|
This pull request has been merged in 5739f77. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack from ghstack:
sync_params is a misnomer since we don't actually synchroniz
parameters. While removing this I realized
self._check_and_sync_module_buffersdoes almost everything we need it to, sojust refactored that and made DDP forward call into it.
Differential Revision: D30751231
cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23