Skip to content

Commit 205ae5c

Browse files
authored
Replaced torch dist launch by torchru (#164)
1 parent 738732b commit 205ae5c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/blog/2020-09-10-pytorch-ignite.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ PyTorch-Ignite provides an ensemble of metrics dedicated to many Deep Learning t
698698

699699
- For classification : `Precision`, `Recall`, `Accuracy`, `ConfusionMatrix` and more!
700700
- For segmentation : `DiceCoefficient`, `IoU`, `mIOU` and more!
701-
- ~20 regression metrics, e.g. MSE, MAE, MedianAbsoluteError, etc
701+
- ~20 regression metrics, e.g. MSE, MAE, MedianAbsoluteError, etc
702702
- Metrics that store the entire output history per epoch
703703
- Possible to use with `scikit-learn` metrics, e.g. `EpochMetric`, `AveragePrecision`, `ROC_AUC`, etc
704704
- Easily composable to assemble a custom metric
@@ -942,7 +942,7 @@ with idist.Parallel(backend=backend, **dist_configs) as parallel:
942942
```
943943

944944
2020-08-31 11:27:07,128 ignite.distributed.launcher.Parallel INFO: Initialized distributed launcher with backend: 'gloo'
945-
2020-08-31 11:27:07,128 ignite.distributed.launcher.Parallel INFO: - Parameters to spawn processes:
945+
2020-08-31 11:27:07,128 ignite.distributed.launcher.Parallel INFO: - Parameters to spawn processes:
946946
nproc_per_node: 2
947947
nnodes: 1
948948
node_rank: 0
@@ -951,7 +951,7 @@ with idist.Parallel(backend=backend, **dist_configs) as parallel:
951951
1 : run with config: {'c': 12345} - backend= gloo
952952
2020-08-31 11:27:09,959 ignite.distributed.launcher.Parallel INFO: End of run
953953

954-
The above code with a single modification can run on a GPU, single-node multiple GPUs, single or multiple TPUs etc. It can be executed with the `torch.distributed.launch` tool or by Python and spawning the required number of processes. For more details, see [the documentation](https://pytorch.org/ignite/distributed.html).
954+
The above code with a single modification can run on a GPU, single-node multiple GPUs, single or multiple TPUs etc. It can be executed with the `torchrun` or by Python and spawning the required number of processes. For more details, see [the documentation](https://pytorch.org/ignite/distributed.html).
955955

956956
In addition, methods like `auto_model()`, `auto_optim()` and `auto_dataloader()` help to adapt in a transparent way the provided model, optimizer and data loaders to an existing configuration:
957957

src/blog/2021-06-28-pytorch-ignite-distributed.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Then we will also cover several ways of spawning processes via torch native `tor
5353

5454
- [`torch.multiprocessing.spawn`](https://pytorch.org/docs/stable/multiprocessing.html#torch.multiprocessing.spawn)
5555

56-
- [`torch.distributed.launch`](https://pytorch.org/docs/stable/distributed.html#launch-utility)
56+
- [`torchrun`](https://pytorch.org/docs/stable/elastic/run.html#launcher-api)
5757

5858
- [`horovodrun`](https://horovod.readthedocs.io/en/stable/running_include.html)
5959

@@ -183,7 +183,7 @@ dist.destroy_process_group()
183183
PyTorch-Ignite's `idist` also unifies the distributed codes launching method and makes the distributed configuration setup easier with the
184184
[ignite.distributed.launcher.Parallel (idist Parallel)](https://pytorch.org/ignite/distributed.html#ignite.distributed.launcher.Parallel) context manager.
185185

186-
This context manager has the capability to either spawn `nproc_per_node` (passed as a script argument) child processes and initialize a processing group according to the provided backend or use tools like `torch.distributed.launch`, `slurm`, `horovodrun` by initializing the processing group given the `backend` argument only
186+
This context manager has the capability to either spawn `nproc_per_node` (passed as a script argument) child processes and initialize a processing group according to the provided backend or use tools like `torchrun`, `slurm`, `horovodrun` by initializing the processing group given the `backend` argument only
187187
in a general way.
188188

189189
### With `torch.multiprocessing.spawn`
@@ -212,13 +212,13 @@ python -u ignite_idist.py --backend xla-tpu --nproc_per_node 8 --batch_size 32
212212
PyTorch-Ignite's `idist Parallel` context manager is also compatible
213213
with multiple distributed launchers.
214214

215-
#### With torch.distributed.launch
215+
#### With `torchrun`
216216

217-
Here we are using the `torch.distributed.launch` script in order to
217+
Here we are using the `torchrun` script in order to
218218
spawn the processes:
219219

220220
```bash
221-
python -m torch.distributed.launch --nproc_per_node 2 --use_env ignite_idist.py --backend gloo
221+
torchrun --nproc_per_node 2 ignite_idist.py --backend gloo
222222
```
223223

224224
#### With horovodrun

0 commit comments

Comments
 (0)