code: def convert_kvcache_gpt_neox_heavy_recent(model, config):
      for name, module in reversed(model._modules.items()):
          if len(list(module.children())) > 0:
              model._modules[
                  name
              ] = convert_kvcache_gpt_neox_heavy_recent(module, config)
  
          if isinstance(module, GPTNeoXAttention):
              model._modules[name] = GPTNeoXAttention_Mask(config)
  
      return model
  
imports: import os
  import pdb
  import copy
  import math
  import numpy
  from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  import torch.utils.checkpoint
  import torch.nn.functional
  from torch.cuda.amp import autocast
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from transformers.models.gpt_neox.modeling_gpt_neox import RotaryEmbedding, GPTNeoXAttention, apply_rotary_pos_emb
label_desc: Use image node_id 1 for calling a global function with example usage: convert_kvcache_gpt_neox_heavy_recent(model, config) and returns: model