code: def allgather_fn(
      output_tensor,
      input_tensor,
      group=None,
      async_op=False,
      debug=get_caller_func(),
  ):
      global cdb
      global has_warned_all_gather
      assert (
          cdb is not None and cdb.is_initialized()
      ), "DeepSpeed backend not set, please initialize it using init_process_group()"
      if cdb.has_allgather_base:
          return all_gather_base(
              output_tensor,
              input_tensor,
              group=group,
              async_op=async_op,
              debug=debug,
          )
      else:
          if not has_warned_all_gather and get_rank() == 0:
              utils.logger.warning(
                  "unable to find torch.distributed._all_gather_base. will fall back to "
                  "torch.distributed.all_gather which will result in suboptimal performance. "
                  "please consider upgrading your pytorch installation."
              )
              has_warned_all_gather = True
          output_tensors = list(
              torch.chunk(output_tensor, cdb.get_world_size(group))
          )
          return all_gather(
              output_tensors,
              input_tensor,
              group=group,
              async_op=async_op,
              debug=debug,
          )
  
imports: from enum import Enum
  import torch
  import os
  from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT, default_pg_timeout
  from .constants import *
  from deepspeed.utils.comms_logging import CommsLogger
  from deepspeed.utils import timer, get_caller_func
  from deepspeed.comm.torch import TorchBackend
  from deepspeed import utils
  from datetime import timedelta
  from deepspeed.comm.utils import *
label_desc: Use image node_id 17 for calling a global function with example usage: allgather_fn(output_tensor, input_tensor, group, async_op, debug) and returns: all_gather_base, all_gather