class_docstr: Model class for prompt-tuning or p-tuning a pretrained Megatron model. 
  
  Prompt Tuning initalizes virtual prompt embeddings directly from a copy of
  certain token embeddings from the the pretrained model's vocabulary
  and directly tunes these embedding weights. The token embeddings used in 
  initalization are specified by the user in the config file. The model can 
  be prompt-tuned for multiple tasks at once. virtual prompts are stored in a 
  prompt table and can be added or deleted without disrupting virtual prompts 
  for other tasks. 
  
  P-tuning initializes an LSTM encoder model that generates virtual prompt
  embeddings for every task. Each task shares the same encoder. After ptuning
  is compelete, the learned virtual prompts can be saved to the prompt table
  using add_ptuned_prompts_to_prompt_table(). Thus, if a user wants to add a 
  new virtual prompt via p-tuning, they do not need to retrain on all previous 
  tasks. This gives p-tuning the same task flexiblity as prompt-tuning.
code: def _reconfigure_batch_sizes(self, gbs: int, mbs: int):
      app_state = AppState()
      _reconfigure_microbatch_calculator(
          rank=app_state.global_rank,
          rampup_batch_size=None,
          global_batch_size=gbs,
          micro_batch_size=mbs,
          data_parallel_size=parallel_state.get_data_parallel_world_size(),
      )
  
imports: import itertools
  import re
  from collections import OrderedDict
  from typing import Any, Optional
  import torch
  from omegaconf.dictconfig import DictConfig
  from omegaconf.omegaconf import open_dict
  from pytorch_lightning.trainer.trainer import Trainer
  from torch import Tensor
  from nemo.collections.common.tokenizers.sentencepiece_tokenizer import SentencePieceTokenizer
  from nemo.collections.nlp.metrics.prompt_learning_metrics import AccuracyScore, BLEUScore, ROUGEScores
  from nemo.collections.nlp.models.language_modeling.megatron_base_model import MegatronBaseModel
  from nemo.collections.nlp.modules.common import PromptEncoder, PromptEncoderType, VirtualPromptPlaceholderToken, VirtualPromptSource, VirtualPromptStyle
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.collections.nlp.modules.common.transformer.text_generation import TextGeneration
  from nemo.collections.nlp.parts.nlp_overrides import GradScaler
  from nemo.utils import AppState, logging
label_desc: Use image node_id 15 for calling the MegatronBasePromptLearningModel obj's underlying member method code with example usage: obj._reconfigure_batch_sizes(gbs, mbs) without return types