-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[feat] pp 1/n #5016
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
Merged
[feat] pp 1/n #5016
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a7dea0d
Added changes for RPC plugin
836073b
Add missing kwargs
075bc9b
Fix code format
4a713a5
Loading refactors by introducing is_distributed var, fix optimizer st…
2475064
Add rpc guard
1abf772
Added docstrings and typing
a12d396
resolve comments
tchaton 691dacc
Add additional rpc hook, refactor name of exit process hook for clarity
3569e8f
remove annotation
tchaton 5eaae03
Merge branch 'feat/rpc' of https://github.com/PyTorchLightning/pytorc…
tchaton 168f9b6
Modify behaviour to allow optional return, add test for rpc plugin
3e10f8f
resolve tests
tchaton b4236da
rename is_ddp_based
tchaton 82fad36
Merge branch 'master' into feat/rpc
tchaton ebbdd3e
update
tchaton 9f3fbd7
Merge branch 'feat/rpc' of https://github.com/PyTorchLightning/pytorc…
tchaton aa7cdb2
update for windows
tchaton 85dcd25
update
tchaton 18a37e7
resolve test
tchaton 6dae0f4
code smell
tchaton 9752281
Revert back to init_ddp_connection for backwards compat
b835e21
Merge branch 'master' into feat/rpc
SeanNaren 35be26b
Swap to explicit name for property
ca5cce5
Add missing speed parity increase for CI variability, fix call counts…
512c017
Merge branch 'master' into feat/rpc
SeanNaren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from contextlib import contextmanager | ||
| from enum import Enum | ||
| from typing import Any, Optional, Union | ||
|
|
@@ -21,10 +20,8 @@ | |
| from torch.optim import Optimizer | ||
|
|
||
| from pytorch_lightning.core.lightning import LightningModule | ||
| from pytorch_lightning.core.optimizer import LightningOptimizer | ||
| from pytorch_lightning.utilities import AMPType | ||
| from pytorch_lightning.plugins.rpc_plugin import RPCPlugin | ||
| from pytorch_lightning.utilities.apply_func import move_data_to_device | ||
| from pytorch_lightning.utilities.exceptions import MisconfigurationException | ||
| from pytorch_lightning.utilities.parsing import AttributeDict | ||
|
|
||
| if torch.distributed.is_available(): | ||
|
|
@@ -222,6 +219,18 @@ def __setstate__(self, d): | |
| def on_save(self, checkpoint): | ||
| return checkpoint | ||
|
|
||
| @property | ||
| def rpc_enabled(self): | ||
| return self.ddp_plugin is not None and isinstance(self.ddp_plugin, RPCPlugin) | ||
|
|
||
| @property | ||
| def distributed_sampler_kwargs(self): | ||
| raise NotImplementedError | ||
|
|
||
| @property | ||
| def require_distributed_sampler(self): | ||
| raise NotImplementedError | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. Can we make it return false per default?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is fine for both. An accelerator shouldn't be used. It is metaclass. |
||
|
|
||
| @contextmanager | ||
| def block_ddp_plugin_sync_behaviour(self): | ||
| """ | ||
|
|
||
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
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
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
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
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
Oops, something went wrong.
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.
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.
Do we want a default implementation for that? I.e. returning an empty duct here as default. I don't think having a property raising NotImplementedError in a property is good practice.