def METHOD_NAME(args):
    import torch
    from transformers import CodeGenForCausalLM as hf_codegen
    from transformers import CodeGenTokenizer as hf_tokenizer
    start_mem = query_by_id(args.gpu_id)
    device = torch.device("cuda")
    tokenizer = hf_tokenizer.from_pretrained(args.model_name_or_path)
    model = hf_codegen.from_pretrained(args.model_name_or_path)
    model.to(device)
    model.eval()
    load_mem = query_by_id(args.gpu_id)
    input_ids_np = [np.random.choice(list(tokenizer.decoder.keys()), args.input_len) for _ in range(args.batch_size)]
    input_ids = torch.tensor(input_ids_np)
    input_ids = input_ids.to(device)
    num_loop = 100
    with torch.no_grad():
        for i in range(num_loop):
            # For warmup.
            if num_loop // 2 == i:
                torch.cuda.synchronize()
                start = time.perf_counter()
            model.generate(
                input_ids,
                do_sample=True,
                max_length=args.generate_len + input_ids.shape[-1],
                min_length=args.generate_len + input_ids.shape[-1],
                top_k=args.top_k,
                top_p=args.top_p,
            )
            generate_mem = query_by_id(args.gpu_id)
        torch.cuda.synchronize()
        hf_cost = (time.perf_counter() - start) / (num_loop - num_loop // 2) * 1000
    return hf_cost, load_mem - start_mem, generate_mem - start_mem