code: def _get_default_world_sizes_model_parallel_world_size(
      pipeline_model_parallel_world_size: Optional[int] = None,
  ) -> Tuple[int, int, int]:
      # TODO: revisit if we can fold this into the class for skip logic / avoid duplication
      # of world size computation
      world_size = torch.cuda.device_count()
      tensor_model_parallel_world_size = 1
      data_parallel_size = 1 + (world_size >= 8 and world_size % 2 == 0)
  
      if pipeline_model_parallel_world_size is None:
          pipeline_model_parallel_world_size = world_size // (
              tensor_model_parallel_world_size * data_parallel_size
          )
      else:
          data_parallel_size = world_size // (
              tensor_model_parallel_world_size
              * pipeline_model_parallel_world_size
          )
  
      return (
          tensor_model_parallel_world_size,
          data_parallel_size,
          pipeline_model_parallel_world_size,
      )
  
imports: import os
  import logging
  import itertools
  from typing import Optional, Tuple, List
  import unittest
  import torch
  from torch.testing._internal import common_utils
  from torch.testing._internal import common_cuda
  from torch.testing._internal import common_distributed
  from apex._autocast_utils import _get_autocast_dtypes
  from apex.transformer import parallel_state
  from apex.transformer.pipeline_parallel import utils
  from apex.transformer.pipeline_parallel.schedules.common import FwdStepFunc, build_model, _get_params_for_weight_decay_optimization
  from apex.transformer.pipeline_parallel.schedules.fwd_bwd_no_pipelining import forward_backward_no_pipelining
  from apex.transformer.pipeline_parallel.schedules.fwd_bwd_pipelining_with_interleaving import _forward_backward_pipelining_with_interleaving
  from apex.transformer.pipeline_parallel.schedules.fwd_bwd_pipelining_without_interleaving import forward_backward_pipelining_without_interleaving
  from apex.transformer.testing.distributed_test_base import UccDistributedTestBase
  from apex.transformer.testing import commons
label_desc: Use image node_id 1 for calling a global function with example usage: _get_default_world_sizes_model_parallel_world_size(pipeline_model_parallel_world_size) and returns: tensor_model_parallel_world_size,  data_parallel_size,  pipeline_model_parallel_world_size