* feat: update readme for ppl test
* fix: textual adjustments
* fix: textual adjustments
* Add ipex-llm npu option in setup.py (#11858)
* add ipex-llm npu release
* update example doc
* meet latest release changes
* optimize phi3 memory usage (#11867)
* Update `ipex-llm` default transformers version to 4.37.0 (#11859)
* Update default transformers version to 4.37.0
* Add dependency requirements for qwen and qwen-vl
* Temp fix transformers version for these not yet verified models
* Skip qwen test in UT for now as it requires transformers<4.37.0
* Update performance test regarding updated default `transformers==4.37.0` (#11869)
* Update igpu performance from transformers 4.36.2 to 4.37.0 (#11841)
* upgrade arc perf test to transformers 4.37 (#11842)
* fix load low bit com dtype (#11832)
* feat: add mixed_precision argument on ppl longbench evaluation
* fix: delete extra code
* feat: upgrade arc perf test to transformers 4.37
* fix: add missing codes
* fix: keep perf test for qwen-vl-chat in transformers 4.36
* fix: remove extra space
* fix: resolve pr comment
* fix: add empty line
* fix: add pip install for spr and core test
* fix: delete extra comments
* fix: remove python -m for pip
* Revert "fix load low bit com dtype (#11832)"
This reverts commit
|
||
|---|---|---|
| .. | ||
| make_csv.py | ||
| make_table.py | ||
| ppl.py | ||
| README.md | ||
| run_longbench.py | ||
| run_wikitext.py | ||
Perplexity
Perplexity (PPL) is one of the most common metrics for evaluating language models. This benchmark implementation is adapted from transformers/perplexity and benchmark_patch_llm.py
Environment Preparation
pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
pip install datasets
This is a required step on Linux for APT or offline installed oneAPI. Skip this step for PIP-installed oneAPI.
source /opt/intel/oneapi/setvars.sh
PPL Evaluation
1. Run on Wikitext
An example to run perplexity on wikitext:
python run_wikitext.py --model_path meta-llama/Meta-Llama-3-8B --dataset path=wikitext,name=wikitext-2-raw-v1 --precision sym_int4 --device xpu --stride 512 --max_length 4096
2. Run on THUDM/LongBench dataset
An example to run perplexity on chatglm3-6b using the default Chinese datasets("multifieldqa_zh", "dureader", "vcsum", "lsht", "passage_retrieval_zh")
python run_longbench.py --model_path THUDM/chatglm3-6b --precisions float16 sym_int4 --device xpu --language zh
Notes:
- If you want to test model perplexity on a few selected datasets from the
LongBenchdataset, please use the format below.--datasets narrativeqa qasper ... - The
languageargument will only take effect ifdatasetsisNone. The choices for this argument areen, zh, all, which stands for all the English datasets, all the Chinese datasets and all the datasets respectively during testing. - If you want to test perplexity on pre-downloaded datasets, please specify the
<path/to/dataset>in thedataset_pathargument in your command. - You can run
python make_table.py <input_dir>to summarize the results.