code: def instantiate_pre_norm(
      norm_config: DSNormConfig,
      engine_config: RaggedInferenceEngineConfig,
  ) -> DSPreNormBase:
      """
      Choose an appropriate pre-norm implementation based on the given configurations. Currently,
      this will select between two CUDA implementations, one for LayerNorm and one for RMSNorm.
  
      Arguments:
          norm_config (DSNormConfig): Configuration for the pre-norm module.
          engine_config (RaggedInferenceEngineConfig): Configuration for the inference engine.
  
      Returns:
          A pre-norm module implementing the given configuration.
      """
      if NormTypeEnum(norm_config.type) == NormTypeEnum.LayerNorm:
          module_name = "cuda_pre_ln"
      elif NormTypeEnum(norm_config.type) == NormTypeEnum.RMSNorm:
          module_name = "cuda_pre_rms"
  
      config = ConfigBundle(name=module_name, config=norm_config)
      return DSPreNormRegistry.instantiate_config(config)
  
file_path: DeepSpeed/deepspeed/inference/v2/modules/heuristics.py
imports: from ..config_v2 import RaggedInferenceEngineConfig
  from ..inference_utils import NormTypeEnum
  from .module_registry import ConfigBundle
  from ..modules.configs import DSEmbeddingsConfig, DSLinearConfig, DSMoEConfig, DSNormConfig, DSSelfAttentionConfig, DSUnembedConfig
  from ..modules.interfaces import DSEmbeddingBase, DSEmbeddingRegistry, DSLinearBase, DSLinearRegistry, DSMoEBase, DSMoERegistry, DSPostNormBase, DSPostNormRegistry, DSPreNormBase, DSPreNormRegistry, DSSelfAttentionBase, DSSelfAttentionRegistry, DSUnembedBase, DSUnembedRegistry
label_desc: Use image node_id 6 for calling a global function with example usage: instantiate_pre_norm(norm_config, engine_config) and returns: DSPreNormRegistry