code: def allgather_fn(
      output_tensor,
      input_tensor,
      group=None,
      async_op=False,
      debug=get_caller_func(),
  ):
      global cdb
      assert (
          cdb is not None and cdb.is_initialized()
      ), "DeepSpeed backend not set, please initialize it using init_process_group()"
      if cdb.has_all_gather_into_tensor():
          return all_gather_into_tensor(
              output_tensor,
              input_tensor,
              group=group,
              async_op=async_op,
              debug=debug,
          )
      else:
          if get_rank() == 0:
              utils.logger.warning_once(
                  "unable to find torch.distributed.all_gather_into_tensor. will fall back to "
                  "torch.distributed.all_gather which will result in suboptimal performance. "
                  "please consider upgrading your pytorch installation."
              )
          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: import torch
  import os
  from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT, default_pg_timeout
  from .constants import *
  from .reduce_op import *
  from deepspeed.accelerator import get_accelerator
  from deepspeed.comm.ccl import CCLBackend
  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_into_tensor, all_gather