code: def __init__(self, cfg):
      lora_cfg = cfg.peft.lora_tuning
      if cfg.get("kv_channels", None) is None:
          assert (
              cfg.hidden_size % cfg.num_attention_heads == 0
          ), "hidden_size must be divisible by num_attention_heads if kv_channels is None"
          kv_channels = cfg.hidden_size // cfg.num_attention_heads
      else:
          kv_channels = cfg.kv_channels
      projection_size = kv_channels * cfg.num_attention_heads
      num_query_groups = cfg.get("num_query_groups", None)
      if num_query_groups is None:
          num_query_groups = cfg.num_attention_heads
      qkv_projection_size = projection_size + (
          2 * kv_channels * num_query_groups
      )
  
      config_args = {
          "in_features": cfg.hidden_size,
          "out_features": qkv_projection_size,
          "dim": lora_cfg.adapter_dim,
          "norm_position": None,
          "norm_type": None,
          "activation": "identity",
          "column_init_method": lora_cfg.get(
              "column_init_method", "normal"
          ),
          "row_init_method": lora_cfg.get("row_init_method", "zero"),
          "gather_output": False,
          "dropout": lora_cfg.adapter_dropout,
      }
  
      if lora_cfg.weight_tying:
          position_embedding_strategy = lora_cfg.get(
              "position_embedding_strategy", None
          )
          if position_embedding_strategy is None:
              dim_position_embeddings = 0
          elif position_embedding_strategy == "add":
              dim_position_embeddings = cfg.hidden_size
          elif position_embedding_strategy == "biasadd":
              dim_position_embeddings = 3 * projection_size
          elif position_embedding_strategy == "concat":
              dim_position_embeddings = lora_cfg.adapter_dim
          elif position_embedding_strategy == "mlpconcat":
              dim_position_embeddings = lora_cfg.adapter_dim
          else:
              raise RuntimeError(
                  f"Unknown position embedding strategy {position_embedding_strategy} for tied weights"
              )
          config_args.update(
              {
                  "num_position_embeddings": cfg.num_layers,
                  "dim_position_embeddings": dim_position_embeddings,
                  "position_embedding_strategy": position_embedding_strategy,
              }
          )
          adapter_cfg = LoraKQVAdapterWeightTyingConfig(**config_args)
      else:
          adapter_cfg = LoraKQVAdapterConfig(**config_args)
  
      name_key_to_cfg = {
          AdapterName.LORA_KQV_ADAPTER: adapter_cfg,
      }
      self.name_key_to_mcore_mixins = {
          AdapterName.LORA_KQV_ADAPTER: [
              ("self_attention", MCoreSelfAttentionMixin)
          ]
      }
  
      super().__init__(lora_cfg, name_key_to_cfg)
  
imports: from typing import Dict
  from omegaconf import DictConfig
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, InfusedAdapterConfig, LoraKQVAdapterConfig, LoraKQVAdapterWeightTyingConfig, MLPInfusedAdapterConfig, ParallelLinearAdapterConfig, ParallelLinearAdapterWeightTyingConfig, PromptEncoderAdapterConfig
label_desc: Use image node_id 1 to create a new LoraPEFTConfig object from inherited base classes: PEFTConfig with example: obj = LoraPEFTConfig(cfg)