code: def warmup(
      model,
      input_ids: torch.Tensor,
      masks: torch.Tensor,
      is_decoder: bool,
      new_tokens: int,
      pad_token_id: int,
  ):
      print("Warmup...")
      if is_decoder:
          gen_config = GenerationConfig(
              max_new_tokens=new_tokens,
              min_new_tokens=new_tokens,
              use_cache=True,
              pad_token_id=pad_token_id,
              num_beams=1,
              do_sample=False,
              eos_token_id=None,  # This is required for min_new_tokens to actually have an effect.
          )
          model.generation_config.eos_token_id = None  # greedy_search falls back on this eos_token_id that we need to set to None as well for min_new_tokens to have an effect.
          res = model.generate(
              input_ids,
              attention_mask=masks,
              generation_config=gen_config,
          )
          assert res.shape[1] == new_tokens + input_ids.shape[1]
          del res
      else:
          gen_config = None
          _ = model(input_ids, masks)
      torch.cuda.synchronize()
  
      return gen_config
  
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 3 for calling a global function with example usage: warmup(model, input_ids, masks, is_decoder, new_tokens, pad_token_id) and returns: gen_config