class_docstr: MegatronGPTPTuningModel is a model that combines a base model (GPTSFTModel) with a p-tuning prefix in the
  input word embedding representations using a prompt-encoder as descripted in Liu et al. https://arxiv.org/pdf/2103.10385.pdf
  
  The mixin framework adds the output of prompt-encoder (i.e. the virtual embeddings) inside
  nemo/collections/nlp/modules/common/megatron/language_model.py
docstr: Initialize the p-tuning prompt encoder in the mixin.
  This should only happen in the first stage of the pipeline unlike other PEFT methods like Lora or Adapters
  because p-tuning only adds params at input to the encoder layer.
docstr_tok: ["Initialize","the","p-tuning","prompt","encoder","in","the","mixin",".","This","should","only","happen","in","the","first","stage","of","the","pipeline","unlike","other","PEFT","methods","like","Lora","or","Adapters","because","p-tuning","only","adds","params","at","input","to","the","encoder","layer","."]
code: def init_peft_modules(
      self,
  ):
      """
      Initialize the p-tuning prompt encoder in the mixin.
      This should only happen in the first stage of the pipeline unlike other PEFT methods like Lora or Adapters
      because p-tuning only adds params at input to the encoder layer.
      """
      if not self.first_stage_of_pipeline():
          # There are no params to add if we are not in the first state of the pipeline
          return True
      super().init_peft_modules()
      return True
  
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 2 for calling the MegatronGPTPTuningModel obj's underlying member method code with example usage: obj.init_peft_modules() and returns: True, True