code: def fix_query_key_value_ordering(model, checkpoint_version):
      """Fix up query/key/value matrix ordering if checkpoint
      version is smaller than 2.0
      """
      if checkpoint_version < 2.0:
          if isinstance(model, list):
              assert len(model) == 1
              model = model[0]
          for name, param in model.named_parameters():
              if name.endswith(
                  (".query_key_value.weight", ".query_key_value.bias")
              ):
                  if checkpoint_version == 0:
                      fixed_param = _transpose_first_dim(
                          param.data, 3, True, model
                      )
                  elif checkpoint_version == 1.0:
                      fixed_param = _transpose_first_dim(
                          param.data, 3, False, model
                      )
                  else:
                      print_rank_0(
                          f"Invalid checkpoint version {checkpoint_version}."
                      )
                      sys.exit()
                  param.data.copy_(fixed_param)
              if name.endswith(
                  (".key_value.weight", ".key_value.bias")
              ):
                  if checkpoint_version == 0:
                      fixed_param = _transpose_first_dim(
                          param.data, 2, True, model
                      )
                  elif checkpoint_version == 1.0:
                      fixed_param = _transpose_first_dim(
                          param.data, 2, False, model
                      )
                  else:
                      print_rank_0(
                          f"Invalid checkpoint version {checkpoint_version}."
                      )
                      sys.exit()
                  param.data.copy_(fixed_param)
          print_rank_0(
              " succesfully fixed query-key-values ordering for"
              " checkpoint version {}".format(checkpoint_version)
          )
  
imports: import os
  import random
  import sys
  import numpy
  import torch
  from megatron import update_num_microbatches
  from megatron.core import mpu, tensor_parallel
  from .global_vars import get_args
  from .utils import unwrap_model, print_rank_0
label_desc: Use image node_id 13 for calling a global function with example usage: fix_query_key_value_ordering(model, checkpoint_version) without return types