code: def _reduce(input_):
      """All-reduce the input tensor across model parallel group."""
  
      # Bypass the function if we are using only 1 GPU.
      if get_tensor_model_parallel_world_size() == 1:
          return input_
  
      # All-reduce.
      torch.distributed.all_reduce(
          input_, group=get_tensor_model_parallel_group()
      )
  
      return input_
  
imports: import torch
  from megatron.core.parallel_state import get_tensor_and_expert_parallel_group, get_tensor_model_parallel_group, get_tensor_model_parallel_rank, get_tensor_model_parallel_world_size
  from .utils import split_tensor_along_last_dim
label_desc: Use image node_id 1 for calling a global function with example usage: _reduce(input_) and returns: input_, input_