From cdd1a36f792d99b7bb2335100921c1612b45bd82 Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:35:47 +0800 Subject: [PATCH] Update distributed.md --- docs/en/advanced_tutorials/distributed.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/en/advanced_tutorials/distributed.md b/docs/en/advanced_tutorials/distributed.md index 76bc108231..56b9252e92 100644 --- a/docs/en/advanced_tutorials/distributed.md +++ b/docs/en/advanced_tutorials/distributed.md @@ -23,15 +23,16 @@ We will detail on these APIs in the following chapters. - [init_dist](mmengine.dist.init_dist): Launch function of distributed training. Currently it supports 3 launchers including pytorch, slurm and MPI. It also setup the given communication backends, defaults to NCCL. -If you need to change the runtime timeout (default=30 minutes) for distributed operations that take very long, you can specify a different timeout in your runtime configuration like this: + If you need to change the runtime timeout (default=30 minutes) for distributed operations that take very long, you can specify a different timeout in your `env_cfg` configuration passing in [Runner](mmengine.runner.Runner) like this: -```python -env_cfg = dict( - cudnn_benchmark=True, - mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0), - dist_cfg=dict(backend='nccl', timeout=10800), # Sets the timeout to 3h (10800 seconds) -) -``` + ```python + env_cfg = dict( + cudnn_benchmark=True, + mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0), + dist_cfg=dict(backend='nccl', timeout=10800), # Sets the timeout to 3h (10800 seconds) + ) + runner = Runner(xxx, env_cfg=env_cfg) + ``` ## Query and control