class_docstr: Serve as the single entry point to 3D parallel initialization.
  
  Args:
      rank (int): The rank of current process.
      world_size (int): Size of whole communication world.
      config (Config): Running configuration.
      data_parallel_size (int): Size of data parallel.
      pipeline_parallel_size (int): Size of pipeline parallel.
      tensor_parallel_size (int): Size of tensor parallel.
class_docstr_tok: ["Serve","as","the","single","entry","point","to","3D","parallel","initialization",".","Args",":","rank","(","int",")",":","The","rank","of","current","process",".","world_size","(","int",")",":","Size","of","whole","communication","world",".","config","(","Config",")",":","Running","configuration",".","data_parallel_size","(","int",")",":","Size","of","data","parallel",".","pipeline_parallel_size","(","int",")",":","Size","of","pipeline","parallel",".","tensor_parallel_size","(","int",")",":","Size","of","tensor","parallel","."]
code: def __init__(self, *args):
      super().__init__(*args)
      self.num_group = self.world_size // self.tensor_parallel_size
      self.depth = round(math.pow(self.tensor_parallel_size, 1 / 3))
      assert (
          self.tensor_parallel_size == self.depth**3
      ), f"3D depth ({self.depth}) if not cube root of tensor parallel size ({self.tensor_parallel_size})"
      _check_depth_env_var(self.depth)
  
      self.input_initializer = Initializer_3D_Input(
          self.num_group, self.depth, *args
      )
      self.weight_initializer = Initializer_3D_Weight(
          self.num_group, self.depth, *args
      )
      self.output_initializer = Initializer_3D_Output(
          self.num_group, self.depth, *args
      )
      self.input_x_weight_initializer = Initializer_3D_InputxWeight(
          self.num_group, self.depth, *args
      )
      self.output_x_weight_initializer = Initializer_3D_OutputxWeight(
          self.num_group, self.depth, *args
      )
  
imports: import math
  import torch.distributed
  from colossalai.legacy.global_variables import tensor_parallel_env
  from colossalai.legacy.registry import DIST_GROUP_INITIALIZER
  from ..parallel_mode import ParallelMode
  from .process_group_initializer import ProcessGroupInitializer
label_desc: Use image node_id 1 to create a new Initializer_3D object from inherited base classes: ProcessGroupInitializer with example: obj = Initializer_3D()