code: def _create_ep_parallel_group(self, moe_experts):
      # Call the init process
      self.ep_group = {}
      self.expert_mp_group = {}
      moe_experts = (
          moe_experts if type(moe_experts) is list else [moe_experts]
      )
      for e in moe_experts:
          self.ep_group.update({e: None})
          self.expert_mp_group.update({e: None})
      for moe_ep_size in self.ep_group.keys():
          num_ep_groups = dist.get_world_size() // moe_ep_size
          for i in range(num_ep_groups):
              ep_cnt = i * moe_ep_size
              size = (
                  dist.get_world_size()
                  if moe_ep_size > dist.get_world_size()
                  else moe_ep_size
              )
              ranks = list(range(ep_cnt, ep_cnt + size))
              _ep_group = dist.new_group(ranks)
              if dist.get_rank() in ranks:
                  self.ep_group.update({moe_ep_size: _ep_group})
  
          if dist.get_world_size() > moe_ep_size:
              num_expert_mp_groups = (
                  dist.get_world_size() // num_ep_groups
              )
              expert_mp_size = dist.get_world_size() // moe_ep_size
              for i in range(num_expert_mp_groups):
                  expert_mp_comm_ranks = [
                      i + nr * moe_ep_size
                      for nr in range(expert_mp_size)
                  ]
                  _expert_mp_group = dist.new_group(
                      expert_mp_comm_ranks
                  )
                  if dist.get_rank() in expert_mp_comm_ranks:
                      self.expert_mp_group.update(
                          {moe_ep_size: _expert_mp_group}
                      )
  
imports: import torch
  import time
  import os
  from deepspeed import comm
  from deepspeed.utils.logging import log_dist
  from torch.nn.modules import Module
  from packaging import version
  from deepspeed.runtime.checkpoint_engine.torch_checkpoint_engine import TorchCheckpointEngine
  from deepspeed.utils.timer import SynchronizedWallClockTimer
  from ..runtime.state_dict_factory import SDLoaderFactory
  from ..runtime.weight_quantizer import WeightQuantization
  from ..module_inject import replace_transformer_layer, generic_injection
  from ..comm.comm import init_distributed
  from ..pipe import PipelineModule
  from ..moe.utils import has_moe_layers
  from ..module_inject import LinearAllreduce, LinearLayer, Normalize, ReplaceWithTensorSlicing
  from deepspeed.accelerator import get_accelerator
  from ..module_inject.policy import TransformerPolicy
  from ..module_inject.auto_tp import AutoTP
  from ..module_inject.replace_policy import generic_policies
  from ..module_inject.auto_tp_model_utils import build_bloom_alibi_tensor, build_mpt_atten_bias_tensor, build_mpt_alibi_tensor, get_alibi_mask
  from ..ops.transformer.inference.ds_attention import DeepSpeedSelfAttention
  from ..model_implementations.transformers.ds_transformer import DeepSpeedTransformerInference
  from torch import nn
label_desc: Use image node_id 11 for calling the InferenceEngine obj's underlying member method code with example usage: obj._create_ep_parallel_group(moe_experts) without return types