Skip to content

Commit b4e6207

Browse files
authored
Update ddp_tutorial.rst (#2516)
1. add `dist.destroy_process_group()` in example code block 2. modify the link syntax error about torchrun
1 parent bf728cb commit b4e6207

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

intermediate_source/ddp_tutorial.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,12 @@ Let's still use the Toymodel example and create a file named ``elastic_ddp.py``.
340340
labels = torch.randn(20, 5).to(device_id)
341341
loss_fn(outputs, labels).backward()
342342
optimizer.step()
343+
dist.destroy_process_group()
343344
344345
if __name__ == "__main__":
345346
demo_basic()
346347
347-
One can then run a `torch elastic/torchrun<https://pytorch.org/docs/stable/elastic/quickstart.html>`__ command
348+
One can then run a `torch elastic/torchrun <https://pytorch.org/docs/stable/elastic/quickstart.html>`__ command
348349
on all nodes to initialize the DDP job created above:
349350

350351
.. code:: bash

0 commit comments

Comments
 (0)