code: def run_model_in_thread(
      model,
      in_out,
      tokenizer,
      result,
      warm_up,
      num_beams,
      input_ids,
      out_len,
      actual_in_len,
      num_trials,
      reserved_mem_list=[],
  ):
      for i in range(num_trials + warm_up):
          st = time.perf_counter()
          output_ids = model.generate(
              input_ids,
              do_sample=False,
              max_new_tokens=out_len,
              num_beams=num_beams,
          )
          torch.xpu.synchronize()
          end = time.perf_counter()
          reserved_mem_list.append(
              torch.xpu.memory.memory_reserved() / (1024**3)
          )
          gpu_peak_mem = max(
              reserved_mem_list
          )  # always keep the peak gpu mem at current stage
          output_ids = output_ids.cpu()
          print("model generate cost: " + str(end - st))
          output = tokenizer.batch_decode(output_ids)
          print(output[0])
          actual_out_len = output_ids.shape[1] - actual_in_len
          if i >= warm_up:
              result[in_out].append(
                  [
                      model.first_cost,
                      model.rest_cost_mean,
                      model.encoder_time,
                      actual_in_len,
                      actual_out_len,
                      gpu_peak_mem,
                  ]
              )
  
imports: import torch
  import time
  import gc
  import traceback
  import threading
  import numpy
  from datetime import date
  import os
  import sys
  from benchmark_util import BenchmarkWrapper
  from bigdl.llm.utils.common.log4Error import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: run_model_in_thread(model, in_out, tokenizer, result, warm_up, num_beams, input_ids, out_len, actual_in_len, num_trials, reserved_mem_list) without return types