code: def check_3d_tensor_parallel_rank(rank):
      tp_local_rank, tp_world_size, num_tp_groups = get_tp_info()
  
      for group_id in range(num_tp_groups):
          ranks_in_current_tp_group = range(
              group_id * tp_world_size, (group_id + 1) * tp_world_size
          )
  
          if rank in ranks_in_current_tp_group:
              ip_rank = gpc.get_local_rank(
                  ParallelMode.PARALLEL_3D_INPUT
              )
              wp_rank = gpc.get_local_rank(
                  ParallelMode.PARALLEL_3D_WEIGHT
              )
              op_rank = gpc.get_local_rank(
                  ParallelMode.PARALLEL_3D_OUTPUT
              )
  
              assert ip_rank == tp_local_rank % tp_env.depth_3d
              assert wp_rank == tp_local_rank // tp_env.depth_3d
              assert op_rank == tp_local_rank // (tp_env.depth_3d**2)
  
file_path: colossalai/tests/test_legacy/test_context/test_hybrid_parallel.py
imports: from pathlib import Path
  import torch
  from colossalai.legacy import launch
  from colossalai.legacy.context import reset_seeds
  from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.global_variables import tensor_parallel_env
  from colossalai.testing import free_port, rerun_if_address_is_in_use, spawn
label_desc: Use image node_id 8 for calling a global function with example usage: check_3d_tensor_parallel_rank(rank) without return types