Skip to content
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

move accelerator_connector.py to the connectors subfolder #6033

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename BackendConnector -> AcceleratorConnector
awaelchli committed Feb 17, 2021
commit 612c49aa655a5ee8d4b528905850969a1a4e45f2
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
import horovod.torch as hvd


class BackendConnector(object):
class AcceleratorConnector(object):

def __init__(
self,
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/deprecated_api.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
# 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 pytorch_lightning.trainer.connectors.accelerator_connector import BackendConnector
from pytorch_lightning.trainer.connectors.accelerator_connector import AcceleratorConnector
from pytorch_lightning.trainer.states import RunningStage
from pytorch_lightning.utilities import DeviceType, DistributedType, rank_zero_warn

@@ -22,7 +22,7 @@ class DeprecatedDistDeviceAttributes:
_device_type: DeviceType
_running_stage: RunningStage
num_gpus: int
accelerator_connector: BackendConnector
accelerator_connector: AcceleratorConnector

@property
def on_cpu(self) -> bool:
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/properties.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
from torch.optim import Optimizer

from pytorch_lightning.accelerators import Accelerator
from pytorch_lightning.trainer.connectors.accelerator_connector import BackendConnector
from pytorch_lightning.trainer.connectors.accelerator_connector import AcceleratorConnector
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint, ProgressBarBase
from pytorch_lightning.callbacks.base import Callback
from pytorch_lightning.core.lightning import LightningModule
@@ -51,7 +51,7 @@ class TrainerProperties(ABC):
_state: TrainerState
_weights_save_path: str

accelerator_connector: BackendConnector
accelerator_connector: AcceleratorConnector
callbacks: List[Callback]
checkpoint_connector: CheckpointConnector
limit_val_batches: int
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@

from pytorch_lightning import _logger as log
from pytorch_lightning.accelerators import Accelerator
from pytorch_lightning.trainer.connectors.accelerator_connector import BackendConnector
from pytorch_lightning.trainer.connectors.accelerator_connector import AcceleratorConnector
from pytorch_lightning.callbacks import Callback
from pytorch_lightning.core.datamodule import LightningDataModule
from pytorch_lightning.core.lightning import LightningModule
@@ -308,7 +308,7 @@ def __init__(
self.data_connector = DataConnector(self)
self.optimizer_connector = OptimizerConnector(self)

self.accelerator_connector = BackendConnector(
self.accelerator_connector = AcceleratorConnector(
num_processes, tpu_cores, distributed_backend, auto_select_gpus, gpus, num_nodes, sync_batchnorm, benchmark,
replace_sampler_ddp, deterministic, precision, amp_backend, amp_level, plugins
)