ipex-llm/python/llm/dev/benchmark/all-in-one
Xin Qiu 64ee1d7689 update run_transformer_int4_gpu (#8983)
* xpuperf

* update run.py

* clean upo

* uodate

* update

* meet code review
2023-09-15 15:10:04 +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: update llm benchmark scripts. (#8943) 2023-09-13 12:23:28 +08:00
README.md LLM: update llm benchmark scripts. (#8943) 2023-09-13 12:23:28 +08:00
run-arc.sh LLM: add benchmark scripts on GPU (#8916) 2023-09-07 18:08:17 +08:00
run-spr.sh LLM: update llm latency benchmark. (#8922) 2023-09-07 19:00:19 +08:00
run.py update run_transformer_int4_gpu (#8983) 2023-09-15 15:10:04 +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.

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"
  # - "transformer_int4_gpu"  # on arc
  # - "optimize_model_gpu"  # on arc

Run

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

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

Note

In run-spr.sh, we set optimal environment varaible by source bigdl-nano-init -c, -c stands for disabling jemalloc. Enabling jemalloc may lead to latency increasement after multiple trials.

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

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