code: def print_details_info(outputs, model_config, args, whole_end2end):
      msg: str = ""
  
      if dist.get_rank() == 0:
          msg += "-------Perf Summary-------\n"
          if args.verbose:
              timestamps = outputs[1]
              prefill = []
              encoder = []
              end2end = []
              for timestamp in timestamps:
                  prefill.append(timestamp[1] - timestamp[0])
                  encoder.append(
                      sum(
                          timestamp[i + 1] - timestamp[i]
                          for i in range(1, len(timestamp) - 1)
                      )
                      / (len(timestamp) - 2)
                  )
                  end2end.append(timestamp[-1] - timestamp[0])
  
              mb_avg_end2end = sum(end2end) / len(end2end)
              mb_avg_latency = mb_avg_end2end / (
                  args.output_len * args.mb_size
              )
  
              msg += f"Average prefill time: {sum(prefill) / len(prefill) * 1000:.2f} ms\n"
              msg += f"Average encode time: {sum(encoder) / len(encoder) * 1000:.2f} ms\n"
              msg += f"Average micro batch end2end time: {mb_avg_end2end * 1000:.2f} ms\n"
              msg += f"Average micro batch per token latency: {mb_avg_latency * 1000:.2f} ms\n"
  
          whole_avg_latency = whole_end2end / (
              args.output_len * args.batch_size
          )
          num_layers = getattr(
              model_config, "num_layers", model_config.num_hidden_layers
          )
          num_parameters = (
              num_layers
              * model_config.hidden_size
              * model_config.hidden_size
              * 12
              / args.pp_size
          )
          if args.dtype in ["fp16", "bf16"]:
              num_bytes = 2
          else:
              num_bytes = 4
  
          msg += f"Whole batch end2end time: {whole_end2end * 1000:.2f} ms\n"
          msg += f"Whole batch per token latency: {whole_avg_latency * 1000:.2f} ms\n"
          msg += f"Throughput: {args.output_len * args.batch_size / whole_end2end:.2f} tokens/s\n"
          msg += f"Flops: {num_parameters * num_bytes / whole_avg_latency / 1e12:.2f} TFLOPS\n"
  
      if torch.cuda.is_available():
          msg += f"-------Memory Summary Device:{device_utils.current_device()}-------\n"
          msg += f"Max memory allocated: {device_utils.max_memory_allocated() / GIGABYTE:.2f} GB\n"
          msg += f"Max memory reserved: {device_utils.max_memory_reserved() / GIGABYTE:.2f} GB\n"
  
      print(msg)
  
file_path: ColossalAI/examples/inference/benchmark_llama.py
imports: import argparse
  import time
  import torch
  import torch.distributed
  import transformers
  import colossalai
  import colossalai.utils.device
  from colossalai.inference import InferenceEngine
  from colossalai.testing import clear_cache_before_run, rerun_if_address_is_in_use, spawn
  from colossalai.utils.device import get_current_device
label_desc: Use image node_id 2 for calling a global function with example usage: print_details_info(outputs, model_config, args, whole_end2end) without return types