class_docstr: MegatronGPTAdapterLearningModel is a model that combines a base model (GPTSFTModel) with a adapters.
  This class only supports the canonical Adapter training described in Houlsby et al. (https://arxiv.org/pdf/1902.00751.pdf)
  
  Two adapter's are inserted into each Transformer layer in the base GPT Model.
  
  It is assumed that these set of adapters will then be trained for a specific task.
  Once trained, the adapter weights will be saved and can be re-loaded
  and infused into the same GPT Model for inference.
code: def __init__(
      self,
      cfg: DictConfig,
      trainer: Trainer,
  ):
      self.peft_name_keys = [
          AdapterName.PRE_ATTN_ADAPTER,
          AdapterName.POST_ATTN_ADAPTER,
      ]
      adapter_tuning_cfg = cfg.peft.adapter_tuning
      adapter_cfg = ParallelLinearAdapterConfig(
          in_features=cfg.hidden_size,
          out_features=cfg.hidden_size,
          dim=adapter_tuning_cfg.adapter_dim,
          norm_position=adapter_tuning_cfg.get("norm_position", "pre"),
          norm_type=adapter_tuning_cfg.get(
              "norm_type", "mixedfusedlayernorm"
          ),
          column_init_method=adapter_tuning_cfg.get(
              "column_init_method", "xavier"
          ),
          row_init_method=adapter_tuning_cfg.get(
              "row_init_method", "zero"
          ),
          dropout=adapter_tuning_cfg.adapter_dropout,
      )
  
      self.name_key_to_cfg = {}
      self.name_key_to_mcore_mixins = {}
      for k in self.peft_name_keys:
          self.name_key_to_cfg[k] = adapter_cfg
          self.name_key_to_mcore_mixins[k] = [
              ("", MCoreTransformerLayerMixin)
          ]
  
      self.layer_selection = adapter_tuning_cfg.get(
          "layer_selection", None
      )
      if self.layer_selection is None:
          self.layer_selection = list(range(1, cfg.num_layers + 1))
      super().__init__(cfg, trainer)
  
imports: from omegaconf.dictconfig import DictConfig
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_sft_model import MegatronGPTSFTModel
  from nemo.collections.nlp.modules.common.megatron.adapters.mcore_mixins import MCoreGPTEmbeddingMixin, MCoreSelfAttentionMixin, MCoreTransformerLayerMixin, swap_mcore_mixin
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, InfusedAdapterConfig, LoraKQVAdapterConfig, LoraKQVAdapterWeightTyingConfig, MLPInfusedAdapterConfig, ParallelLinearAdapterConfig, ParallelLinearAdapterWeightTyingConfig, PromptEncoderAdapterConfig
  from nemo.core.classes.mixins import adapter_mixins
  from nemo.utils import logging, model_utils
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 1 to create a new MegatronGPTAdapterModel object from inherited base classes: MegatronGPTLayerwisePEFTModel with example: obj = MegatronGPTAdapterModel(cfg, trainer)