code: def benchmark_latency(
      model,
      input_ids: torch.Tensor,
      masks: torch.Tensor,
      num_batches: int,
      is_decoder: bool,
      new_tokens: int,
      pad_token_id: int,
      memory_tracker: MemoryTracker,
  ):
      torch.cuda.empty_cache()
      gc.collect()
  
      gen_config = warmup(
          model,
          input_ids,
          masks,
          is_decoder,
          new_tokens,
          pad_token_id,
      )
  
      print("Measuring latency...")
      total_time = timing_cuda(
          model, num_batches, input_ids, masks, is_decoder, gen_config
      )
  
      return total_time
  
file_path: optimum/tests/benchmark/benchmark_gptq.py
imports: import argparse
  import gc
  import os
  import time
  import numpy
  import torch
  from auto_gptq.utils import Perplexity
  from memory_tracker import MemoryTracker
  from tqdm import tqdm
  from transformers import AutoModel, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoTokenizer, BitsAndBytesConfig, GenerationConfig, GPTQConfig
  from optimum.exporters import TasksManager
label_desc: Use image node_id 4 for calling a global function with example usage: benchmark_latency(model, input_ids, masks, num_batches, is_decoder, new_tokens, pad_token_id, memory_tracker) and returns: total_time