code: def main(
      local_rank,
      rank,
      world_size,
      uuid,
      init_method: str = "tcp://localhost:23456",
  ):
      with monit.section("Distributed"):
          torch.distributed.init_process_group(
              "gloo",
              timeout=datetime.timedelta(seconds=30),
              init_method=init_method,
              rank=rank,
              world_size=world_size,
          )
      conf = Configs()
      experiment.create(uuid=uuid, name="mnist ddp")
      experiment.distributed(local_rank, world_size)
      experiment.configs(
          conf,
          {
              "optimizer.optimizer": "Adam",
              "optimizer.learning_rate": 1e-4,
              "model": "ddp_model",
              "device.cuda_device": local_rank,
          },
      )
      conf.set_seed.set()
      experiment.add_pytorch_models(dict(model=conf.model))
      with experiment.start():
          conf.run()
  
file_path: labml/samples/ddp/mnist.py
imports: import datetime
  import torch.distributed
  from torch.nn.parallel import DistributedDataParallel
  from labml import experiment, monit
  from labml.configs import option
  from labml.logger import inspect
  from pytorch.mnist.e_labml_helpers import Configs, Net
label_desc: Use image node_id 2 for calling a global function with example usage: main(local_rank, rank, world_size, uuid, init_method) without return types