From 8b62eef9d0d9c863e88c0992595688d6289d954f Mon Sep 17 00:00:00 2001 From: Nils Werner Date: Thu, 16 Dec 2021 19:39:07 +0100 Subject: [PATCH] Rename accelerator="ddp" to strategy="ddp" (#228) --- README.md | 6 +++--- configs/trainer/ddp.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4370195..af5f4ff 100644 --- a/README.md +++ b/README.md @@ -174,10 +174,10 @@ python run.py trainer.gpus=1 python run.py +trainer.tpu_cores=8 # train with DDP (Distributed Data Parallel) (4 GPUs) -python run.py trainer.gpus=4 +trainer.accelerator=ddp +python run.py trainer.gpus=4 +trainer.strategy=ddp # train with DDP (Distributed Data Parallel) (8 GPUs, 2 nodes) -python run.py trainer.gpus=4 +trainer.num_nodes=2 +trainer.accelerator=ddp +python run.py trainer.gpus=4 +trainer.num_nodes=2 +trainer.strategy=ddp ``` @@ -915,7 +915,7 @@ The most common one is DDP, which spawns separate process for each GPU and avera You can run DDP on mnist example with 4 GPUs like this: ```bash -python run.py trainer.gpus=4 +trainer.accelerator="ddp" +python run.py trainer.gpus=4 +trainer.strategy=ddp ``` ⚠️ When using DDP you have to be careful how you write your models - learn more [here](https://pytorch-lightning.readthedocs.io/en/latest/advanced/multi_gpu.html). diff --git a/configs/trainer/ddp.yaml b/configs/trainer/ddp.yaml index cd67f23..b798479 100644 --- a/configs/trainer/ddp.yaml +++ b/configs/trainer/ddp.yaml @@ -2,4 +2,4 @@ defaults: - default.yaml gpus: 4 -accelerator: ddp +strategy: ddp