-
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
[bug-fix] Call transfer_batch_to_device in DDPlugin #5195
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5195 +/- ##
======================================
Coverage 93% 93%
======================================
Files 134 134
Lines 9994 9998 +4
======================================
+ Hits 9309 9314 +5
+ Misses 685 684 -1 |
So a couple of things:
We should not enforce move to device. This wouldn't work in cases where custom distributed accelerators need to move device differently imo. It should be up to the plugin to do what's necessary. Also when using DDP we do not need to manually move tensors to the appropriate device? |
Hello @tchaton! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-01-08 15:39:36 UTC |
@tchaton can you have a look at the above comment? I don't think we should merge this. |
Can you update the CHANGELOG? (after #5378 is merged) |
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.
not liking the device_ids assignment but we will be able to handle that more elegantly through the refactor. otherwise LGTM thanks for taking a look at this.
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
* hacking out * update * remove useless on_before_forward * update * remove overriden * iremove os * use on_before_forward * resolve flake8 * add test * update * add single_process_per_device * resolve flake8 * update * resolve * update * update * update * add comment * resolve bug with sharded * update * remove property * update * resolve test * resolve bug * update on comments * update doc * Update pytorch_lightning/core/hooks.py Co-authored-by: Rohit Gupta <[email protected]> * update on comments * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * Update pytorch_lightning/plugins/ddp_plugin.py Co-authored-by: Rohit Gupta <[email protected]> * resolve pep8 * add device_ids to pipe * update on comments * update * resolve * update * update * update Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Sean Naren <[email protected]> (cherry picked from commit d510707)
What does this PR do?
This PR moves transfer_batch_to_device from
ddp_sharded
toddp_plugin
inon_before_forward
Partially solves #2350
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃