code: def gather_split_1d_tensor(tensor: torch.Tensor) -> torch.Tensor:
      """Opposite of above function, gather values from model parallel ranks.
  
      Args:
          tensor (:class:`torch.Tensor`): Tensor to be gathered after communication.
      Returns:
          :class:`torch.Tensor`: The gathered tensor.
      """
      world_size = gpc.get_world_size(ParallelMode.PARALLEL_1D)
      numel = torch.numel(tensor)
      numel_gathered = world_size * numel
      gathered = torch.empty(
          numel_gathered,
          dtype=tensor.dtype,
          device=torch.cuda.current_device(),
          requires_grad=False,
      )
      chunks = [
          gathered[i * numel : (i + 1) * numel]
          for i in range(world_size)
      ]
      dist.all_gather(
          chunks, tensor, group=gpc.get_group(ParallelMode.PARALLEL_1D)
      )
      return gathered
  
file_path: colossalai/colossalai/legacy/communication/utils.py
imports: from typing import List, Tuple, Union
  import torch
  import torch.distributed
  from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.utils import get_current_device
label_desc: Use image node_id 6 for calling a global function with example usage: gather_split_1d_tensor(tensor) and returns: gathered