code: def _reduce(ctx: Any, input_: torch.Tensor) -> torch.Tensor:
      """All-reduce the the input tensor across model parallel group."""
      group = get_model_parallel_group()
  
      if ctx:
          ctx.mark_dirty(input_)
  
      # Bypass the function if we are using only 1 GPU.
      if torch.distributed.get_world_size(group=group) == 1:
          return input_
  
      # All-reduce.
      torch.distributed.all_reduce(input_, group=group)
  
      return input_
  
imports: from typing import Any
  import torch
  from .initialize import get_model_parallel_group
  from .utils import split_tensor_along_last_dim
label_desc: Use image node_id 1 for calling a global function with example usage: _reduce(ctx, input_) and returns: input_, input_