code: def model_cfg(test_data_dir):
      model_cfg = {
          "precision": 16,
          "micro_batch_size": 4,
          "global_batch_size": 8,
          "tensor_model_parallel_size": 1,
          "pipeline_model_parallel_size": 1,
          "resume_from_checkpoint": None,
          "encoder_seq_length": 512,
          "max_position_embeddings": 512,
          "num_layers": 1,
          "hidden_size": 128,
          "ffn_hidden_size": 512,
          "num_attention_heads": 2,
          "init_method_std": 0.02,
          "hidden_dropout": 0.1,
          "kv_channels": None,
          "apply_query_key_layer_scaling": True,
          "layernorm_epsilon": 1e-5,
          "make_vocab_size_divisible_by": 128,
          "pre_process": True,
          "post_process": True,
          "persist_layer_norm": True,
          "gradient_as_bucket_view": True,
          "tokenizer": {
              "library": "megatron",
              "type": "GPT2BPETokenizer",
              "model": None,
              "vocab_file": os.path.join(
                  test_data_dir, "nlp/gpt_vocab_merges/vocab.json"
              ),
              "merge_file": os.path.join(
                  test_data_dir, "nlp/gpt_vocab_merges/merges.txt"
              ),
              "delimiter": None,
          },
          "native_amp_init_scale": 4294967296,
          "native_amp_growth_interval": 1000,
          "hysteresis": 2,
          "fp32_residual_connection": False,
          "fp16_lm_cross_entropy": False,
          "megatron_amp_O2": False,
          "seed": 1234,
          "use_cpu_initialization": False,
          "onnx_safe": False,
          "apex_transformer_log_level": 30,
          "activations_checkpoint_method": None,
          "activations_checkpoint_num_layers": 1,
          "data": {
              "data_prefix": "???",
              "index_mapping_dir": None,
              "data_impl": "mmap",
              "splits_string": "900,50,50",
              "seq_length": 512,
              "skip_warmup": True,
              "num_workers": 2,
              "dataloader_type": "single",
              "reset_position_ids": False,
              "reset_attention_mask": False,
              "eod_mask_loss": False,
          },
          "optim": {
              "name": "fused_adam",
              "lr": 2e-4,
              "weight_decay": 0.01,
              "betas": [0.9, 0.98],
              "sched": {
                  "name": "CosineAnnealing",
                  "warmup_steps": 500,
                  "constant_steps": 50000,
                  "min_lr": "2e-5",
              },
          },
      }
      return model_cfg
  
file_path: NeMo/tests/collections/nlp/test_gpt_model.py
imports: import os
  import pytest
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.tokenizers.huggingface.auto_tokenizer import AutoTokenizer
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.modules.common.megatron.utils import get_ltor_masks_and_position_ids
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy
label_desc: Use image node_id 1 for calling a global function with example usage: model_cfg(test_data_dir) and returns: model_cfg