code: def test_auto_methods_gloo(distributed_context_single_node_gloo):
      ws = distributed_context_single_node_gloo["world_size"]
      _test_auto_dataloader(ws=ws, nproc=ws, batch_size=1)
      _test_auto_dataloader(
          ws=ws, nproc=ws, batch_size=10, num_workers=2
      )
      _test_auto_dataloader(
          ws=ws,
          nproc=ws,
          batch_size=10,
          sampler_name="WeightedRandomSampler",
      )
      _test_auto_dataloader(
          ws=ws,
          nproc=ws,
          batch_size=10,
          sampler_name="DistributedSampler",
      )
  
      device = idist.device()
      _test_auto_model_optimizer(ws, device)
  
      if ws > 1 and device.type == "cpu":
          # Pytorch <= 1.9.0 => AssertionError
          # Pytorch >  1.9   => ValueError
          # https://github.com/pytorch/pytorch/blob/master/torch/nn/parallel/distributed.py#L1498
          with pytest.raises(
              (AssertionError, ValueError),
              match=r"SyncBatchNorm layers only work with (GPU|CUDA) modules",
          ):
              model = nn.Sequential(
                  nn.Linear(20, 100), nn.BatchNorm1d(100)
              )
              auto_model(model, sync_bn=True)
  
imports: import os
  import pytest
  import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from torch.utils.data.dataloader import _InfiniteConstantSampler
  from torch.utils.data.dataset import Dataset, IterableDataset
  from torch.utils.data.distributed import DistributedSampler
  from torch.utils.data.sampler import BatchSampler, RandomSampler, Sampler, SequentialSampler, WeightedRandomSampler
  import ignite.distributed
  from ignite.distributed.auto import auto_dataloader, auto_model, auto_optim, DistributedProxySampler
label_desc: Use image node_id 8 for calling a global function with example usage: test_auto_methods_gloo(distributed_context_single_node_gloo) without return types