-
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
Initialize trainer with None in DDPAccelerator #4915
Changes from 12 commits
06b604a
463942a
4449612
745eddd
af231f0
63df576
c08e93a
d444595
fa4a8b8
abeaff0
2b30bd1
a5aa541
c147db3
a7ea199
40b1b13
416966c
e86434f
a7724bf
f17967e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,8 +19,12 @@ | |||||
import torch.distributed as torch_distrib | ||||||
from torch.optim import Optimizer | ||||||
|
||||||
import pytorch_lightning as pl | ||||||
from pytorch_lightning.cluster_environments import ClusterEnvironment | ||||||
from pytorch_lightning.core.lightning import LightningModule | ||||||
from pytorch_lightning.plugins.ddp_plugin import DDPPlugin | ||||||
from pytorch_lightning.plugins.rpc_plugin import RPCPlugin | ||||||
from pytorch_lightning.utilities import AMPType | ||||||
from pytorch_lightning.utilities.apply_func import move_data_to_device | ||||||
from pytorch_lightning.utilities.parsing import AttributeDict | ||||||
|
||||||
|
@@ -33,7 +37,10 @@ class ReduceOp: | |||||
|
||||||
class Accelerator(object): | ||||||
|
||||||
def __init__(self, trainer=None, cluster_environment=None, ddp_plugin=None): | ||||||
def __init__(self, | ||||||
trainer: Optional['pl.Trainer'] = None, | ||||||
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.
Suggested change
as it is string you do not need the pl 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. You need it for the doc. 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 it breaks the doc. |
||||||
cluster_environment: Optional[ClusterEnvironment] = None, | ||||||
ddp_plugin: Optional[DDPPlugin] = None): | ||||||
self.trainer = trainer | ||||||
self.nickname = None | ||||||
self.cluster_environment = cluster_environment | ||||||
|
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.
pls do not use this call inside PL
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.
It doesn't work with the doc when I do.