code: def display_results(
      model_size, tp, bs, sla_token_gen, 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)
  
      print(
          f"model: {model_size} Prompt: {prompt}, Generation: {gen}, TP: {tp} sla_token_gen: {sla_token_gen}"
      )
  
      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"
  
      validate_funcs = [
          (validate_token_cum_latency_SLA, (), "cum"),
          (
              validate_token_ema_latency_SLA,
              (EMA_SPAN,),
              f"ema{EMA_SPAN}",
          ),
      ]
  
      for f in validate_funcs:
          mii_goodputs, mii_good_ratios = extract_values(
              mii_file_pattern, sla_token_gen, f
          )
          client_num_list = sorted(list(mii_goodputs.keys()))
          mii_goodputs_list = [
              mii_goodputs[client_num] for client_num in client_num_list
          ]
  
          if not args.no_vllm:
              vllm_goodputs, vllm_good_ratios = extract_values(
                  vllm_file_pattern, sla_token_gen, f
              )
              vllm_goodputs_list = [
                  vllm_goodputs[client_num]
                  for client_num in client_num_list
              ]
  
          # print(f"MII {mii_goodputs_list} ratio={mii_good_ratios}")
          # print(f"vLLM {vllm_goodputs_list} ratio={vllm_good_ratios}")
  
          # Plotting the scatter plot
          plt.figure(figsize=(7, 4))
          plt.scatter(
              client_num_list,
              mii_goodputs_list,
              label=f"DeepSpeed-FastGen",
              marker="o",
              color="blue",
          )
          if not args.no_vllm:
              plt.scatter(
                  client_num_list,
                  vllm_goodputs_list,
                  label=f"vLLM",
                  marker="x",
                  color="orange",
              )
  
          fit_x_list = np.arange(
              min(client_num_list), max(client_num_list), 0.1
          )
          mii_fit_model = np.polyfit(
              client_num_list, mii_goodputs_list, 4
          )
          mii_model_fn = np.poly1d(mii_fit_model)
          plt.plot(
              fit_x_list,
              mii_model_fn(fit_x_list),
              color="blue",
              alpha=0.5,
              linestyle="--",
          )
  
          if not args.no_vllm:
              vllm_fit_model = np.polyfit(
                  client_num_list, vllm_goodputs_list, 4
              )
              vllm_model_fn = np.poly1d(vllm_fit_model)
              plt.plot(
                  fit_x_list,
                  vllm_model_fn(fit_x_list),
                  color="orange",
                  alpha=0.5,
                  linestyle="--",
              )
  
          title = (
              f"Effective throughput (SLA prompt: {SLA_PROMPT_TOKENS_PER_SEC} tokens/s, generation: {sla_token_gen} tokens/s)\n"
              + f"Llama 2 {model_size.upper()} Prompt: {prompt}, Generation: {gen}, TP: {tp}"
          )
          plt.title(title, fontsize=10)
          plt.xlabel("Number of clients", fontsize=10)
          plt.ylabel("Effective throughput (queries/s)", fontsize=10)
          # plt.rcParams['figure.subplot.bottom'] = 0.30
          plt.ylim(bottom=-0.05)
          plt.legend()
          plt.grid(True)
          # plt.show()
          out_file = (
              out_dir
              / f"goodput_llama{model_size}_SLAp{SLA_PROMPT_TOKENS_PER_SEC}g{sla_token_gen}_tp{tp}_b{bs}_p{prompt}g{gen}_{f[2]}.png"
          )
          plt.savefig(out_file)
          plt.clf()
          print(f"Saved {out_file}")
  
file_path: deepspeedexamples/benchmarks/inference/mii/plot_effective_throughput.py
imports: import argparse
  from pathlib import Path
  import glob
  import matplotlib.pyplot
  import numpy
  import pandas
  from postprocess_results import read_json, get_tokenizer
label_desc: Use image node_id 8 for calling a global function with example usage: display_results(model_size, tp, bs, sla_token_gen, prompt, gen, log_dir, out_dir) without return types