ipex-llm/python/llm/dev/benchmark/all-in-one
2023-10-11 17:13:34 +08:00
..
prompt transformer int4 and native int4's benchmark script for 32 256 1k 2k input (#8871) 2023-09-07 09:49:55 +08:00
config.yaml LLM: add benchmark script for Max gpu and ipex fp16 gpu (#9112) 2023-10-10 10:18:41 +08:00
README.md LLM: add benchmark script for Max gpu and ipex fp16 gpu (#9112) 2023-10-10 10:18:41 +08:00
run-arc.sh LLM: add benchmark scripts on GPU (#8916) 2023-09-07 18:08:17 +08:00
run-max-gpu.sh LLM: add benchmark script for Max gpu and ipex fp16 gpu (#9112) 2023-10-10 10:18:41 +08:00
run-spr.sh LLM: Enable jemalloc in benchmark scripts. (#9058) 2023-09-26 15:37:49 +08:00
run.py LLM: fix inaccurate input / output tokens of current all-in-one benchmark (#9137) 2023-10-11 17:13:34 +08:00

All in One Benchmark Test

All in one benchmark test allows users to test all the benchmarks and record them in a result CSV. Users can provide models and related information in config.yaml.

Before running, make sure to have bigdl-llm and bigdl-nano installed.

Dependencies

pip install omegaconf
pip install pandas

Config

Config YAML file has following format

repo_id:
  - 'THUDM/chatglm-6b'
  - 'THUDM/chatglm2-6b'
  - 'meta-llama/Llama-2-7b-chat-hf'
local_model_hub: 'path to your local model hub'
warm_up: 1
num_trials: 3
in_out_pairs:
  - '32-32'
  - '1024-128'
test_api:
  - "transformer_int4"
  - "native_int4"
  - "optimize_model"
  - "pytorch_autocast_bf16"
  # - "ipex_fp16_gpu" # on Intel GPU
  # - "transformer_int4_gpu"  # on Intel GPU
  # - "optimize_model_gpu"  # on Intel GPU

Run

run python run.py, this will output results to results.csv.

For SPR performance, run bash run-spr.sh.

Note

The value of OMP_NUM_THREADS should be the same as the cpu cores specified by numactl -C.

Note

Please install torch nightly version to avoid Illegal instruction (core dumped) issue, you can follow the following command to install: pip install --pre --upgrade torch --index-url https://download.pytorch.org/whl/nightly/cpu

For ARC performance, run bash run-arc.sh.