code: def main_worker(rank, ngpus_per_node, port):
      dist.init_process_group(
          backend="nccl",
          init_method=f"tcp://127.0.0.1:{port}",
          world_size=ngpus_per_node,
          rank=rank,
      )
      # `benchmark = True` is not compatible with openCV in PyTorch 22.09 docker for multi-gpu training
      torch.backends.cudnn.benchmark = True
  
      model = torch.nn.Conv3d(
          in_channels=1, out_channels=32, kernel_size=3, bias=True
      ).to(rank)
      model = torch.nn.parallel.DistributedDataParallel(
          model,
          device_ids=[rank],
          output_device=rank,
          find_unused_parameters=False,
      )
      x = torch.ones(1, 1, 12, 12, 12).to(rank)
      with autocast(enabled=True):
          model(x)
  
      if dist.is_initialized():
          dist.destroy_process_group()
  
file_path: MONAI/tests/test_cv2_dist.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  import torch.distributed
  from torch.cuda.amp import autocast
  from monai.config.deviceconfig import print_config
  from tests.utils import skip_if_no_cuda
label_desc: Use image node_id 1 for calling a global function with example usage: main_worker(rank, ngpus_per_node, port) without return types