code: def setup_torch_distributed(
      local_procs=2, max_retries=0
  ) -> launcher.LaunchConfig:
      # set up distributed backend.
      os.environ[det._DistributedBackend.TORCH] = str(1)
  
      rdzv_backend = "c10d"
      rdzv_endpoint = "localhost:29400"
      rdzv_id = str(uuid.uuid4())
  
      launch_config = launcher.LaunchConfig(
          min_nodes=1,
          max_nodes=1,
          nproc_per_node=local_procs,
          run_id=rdzv_id,
          max_restarts=max_retries,
          rdzv_endpoint=rdzv_endpoint,
          rdzv_backend=rdzv_backend,
      )
  
      return launch_config
  
file_path: determined/harness/tests/experiment/pytorch_utils.py
imports: import os
  import pathlib
  import random
  import sys
  import typing
  import uuid
  from torch.distributed import launcher
  import determined
  from determined import gpu, pytorch
  from tests.experiment import utils
label_desc: Use image node_id 5 for calling a global function with example usage: setup_torch_distributed(local_procs, max_retries) and returns: launch_config