code: def output_charts(model_size, tp, bs, prompt, gen, log_dir, out_dir):
      if not log_dir.exists():
          print(f"Log directory {log_dir} does not exist")
          return
  
      if not out_dir.exists():
          out_dir.mkdir(parents=True, exist_ok=True)
  
      mii_file_pattern = f"{log_dir}/logs.llama2-{model_size}-tp{tp}-b{bs}/llama2-{model_size}-tp{tp}-b{bs}_c*_p{prompt}_g{gen}.json"
      if not args.no_vllm:
          vllm_file_pattern = f"{log_dir}/logs.vllm-llama2-{model_size}-tp{tp}/vllm-llama2-{model_size}-tp{tp}_c*_p{prompt}_g{gen}.json"
  
      _, mii_throughputs, mii_latencies = extract_values(
          mii_file_pattern
      )
      if not args.no_vllm:
          _, vllm_throughputs, vllm_latencies = extract_values(
              vllm_file_pattern
          )
  
      # Plotting the scatter plot
      plt.figure(figsize=(6, 4))
  
      if not args.no_vllm:
          plt.scatter(
              vllm_throughputs,
              vllm_latencies,
              label=f"vLLM",
              marker="x",
              color="orange",
          )
          fit_vllm_x_list = np.arange(
              min(vllm_throughputs), max(vllm_throughputs), 0.01
          )
          vllm_vllm_model = np.polyfit(
              vllm_throughputs, vllm_latencies, 3
          )
          vllm_model_fn = np.poly1d(vllm_vllm_model)
          plt.plot(
              fit_vllm_x_list,
              vllm_model_fn(fit_vllm_x_list),
              color="orange",
              alpha=0.5,
              linestyle="--",
          )
  
      plt.scatter(
          mii_throughputs,
          mii_latencies,
          label=f"DeepSpeed FastGen",
          marker="o",
          color="blue",
      )
      fit_mii_x_list = np.arange(
          min(mii_throughputs), max(mii_throughputs), 0.01
      )
      mii_fit_model = np.polyfit(mii_throughputs, mii_latencies, 3)
      mii_model_fn = np.poly1d(mii_fit_model)
      plt.plot(
          fit_mii_x_list,
          mii_model_fn(fit_mii_x_list),
          color="blue",
          alpha=0.5,
          linestyle="--",
      )
  
      plt.title(
          f"Model Llama 2 {model_size.upper()}, Prompt: {prompt}, Generation: {gen}, TP: {tp}"
      )
      plt.xlabel("Throughput (queries/s)", fontsize=14)
      plt.ylabel("Latency", fontsize=14)
      plt.legend()
      plt.grid(True)
      plt.tight_layout()
      out_file = (
          out_dir
          / f"th_lat_curve_llama{model_size}_tp{tp}_p{prompt}g{gen}.png"
      )
      print(f"Saving {out_file}")
      plt.savefig(out_file)
  
file_path: deepspeedexamples/benchmarks/inference/mii/plot_th_lat.py
imports: import glob
  import matplotlib.pyplot
  import argparse
  from pathlib import Path
  import numpy
  import pdb
  from postprocess_results import read_json, get_summary
label_desc: Use image node_id 3 for calling a global function with example usage: output_charts(model_size, tp, bs, prompt, gen, log_dir, out_dir) without return types