Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7d020db
fix a bug in example
wenhuach21 Mar 18, 2024
fbe69d5
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 19, 2024
596a18f
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 20, 2024
10add8c
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 21, 2024
003b60a
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 24, 2024
9d49514
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 25, 2024
3b7f386
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 27, 2024
d3f14df
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Mar 27, 2024
76e4d90
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 3, 2024
08e46ac
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 9, 2024
15b756b
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 9, 2024
40425bb
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 11, 2024
f0b9ad0
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 17, 2024
04e70ec
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 20, 2024
43811bb
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 24, 2024
c881719
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 25, 2024
54920e5
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 Apr 30, 2024
e2c2f56
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 1, 2024
4f718d4
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 1, 2024
022988a
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 9, 2024
b4eb679
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 10, 2024
0abbde8
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 16, 2024
aed8be0
fix gradient_accmulate bug in lm-head
wenhuach21 May 20, 2024
018eeb8
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 23, 2024
0fd4a92
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 24, 2024
47f5efe
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 24, 2024
f4814f2
correct the doc
wenhuach21 May 24, 2024
d92be56
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 25, 2024
3847bff
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 27, 2024
f102931
remove fp32 conversion as no need now
wenhuach21 May 27, 2024
77dca2c
Merge branch 'main' of https://github.com/intel/auto-round
wenhuach21 May 27, 2024
d201814
update phi2 recipe and remove falcon data as we don't trust the qdq a…
wenhuach21 May 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ print(tokenizer.decode(model.generate(**inputs, max_new_tokens=50)[0]))
| Intel/neural-chat-7b-v3-3 | [HF-int4-model](https://huggingface.co/Intel/neural-chat-7b-v3-3-int4-inc), [accuracy](./docs/neural-chat-7b-v3-3-acc.md), [recipe](./examples/language-modeling/scripts/neural-chat-7b-v3-3.sh), [example](./examples/language-modeling/) |
| Intel/neural-chat-7b-v3-1 | [HF-int4-model](https://huggingface.co/Intel/neural-chat-7b-v3-1-int4-inc), [accuracy](./docs/neural-chat-7b-v3-1-acc.md), [recipe](./examples/language-modeling/scripts/neural-chat-7b-v3-1.sh), [example](./examples/language-modeling/) |
| mistralai/Mistral-7B-v0.1 | [HF-int4-model-lmhead](https://huggingface.co/Intel/Mistral-7B-v0.1-int4-inc-lmhead),[HF-int4-model](https://huggingface.co/Intel/Mistral-7B-v0.1-int4-inc), [accuracy](./docs/Mistral-7B-v0.1-acc.md), [recipe](./examples/language-modeling/scripts/Mistral-7B-v0.1.sh), [example](./examples/language-modeling/) |
| microsoft/phi-2 | [HF-int4-model](https://huggingface.co/Intel/phi-2-int4-inc), [accuracy](./docs/phi-2-acc.md), [recipe](./examples/language-modeling/scripts/phi-2.sh), [example](./examples/language-modeling/)
| tiiuae/falcon-7b | [HF-int4-model](https://huggingface.co/Intel/falcon-7b-int4-inc), [accuracy](./docs/falcon-7b-acc.md), [recipe](./examples/language-modeling/scripts/falcon-7b.sh), [example](./examples/language-modeling/) |
| microsoft/phi-2 | [HF-int4-sym-model](https://huggingface.co/Intel/phi-2-int4-inc), [accuracy](./docs/phi-2-acc.md), [recipe](./examples/language-modeling/scripts/phi-2.sh), [example](./examples/language-modeling/)
| google/gemma-2b | [HF-int4-model](https://huggingface.co/Intel/gemma-2b-int4-inc), [accuracy](./docs/gemma-2b-acc.md), [recipe](./examples/language-modeling/scripts/gemma-2b.sh), [example](./examples/language-modeling/)
| mistralai/Mistral-7B-Instruct-v0.2 | [HF-int4-model](https://huggingface.co/Intel/Mistral-7B-Instruct-v0.2-int4-inc) (under review), [accuracy](./docs/Mistral-7B-Instruct-v0.2-acc.md), [recipe](./examples/language-modeling/scripts/Mistral-7B-Instruct-v0.2.sh), [example](./examples/language-modeling/) |
| google/gemma-7b | [HF-int4-model](https://huggingface.co/Intel/gemma-7b-int4-inc) (under review), [accuracy](./docs/gemma-7b-acc.md), [recipe](./examples/language-modeling/scripts/gemma-7b.sh), [example](./examples/language-modeling/) |
Expand Down
12 changes: 6 additions & 6 deletions docs/phi-2-acc.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Install [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness.git) from source, and the git id f3b7917091afba325af3980a35d8a6dcba03dc3f is used
pip install lm-eval==0.4.2

Download the model from hf(coming soon) or follow examples/language-modeling/scripts/phi-2.sh to generate the model
Due to the significant accuracy drop with the asymmetric kernel for this model, we opted to use symmetric quantization.

Since we encountered an issue evaluating this model with lm-eval, we opted to evaluate the qdq model instead. In our assessment, we found that its accuracy closely matches that of the real quantized model in most cases except for some small models like opt-125m.
```bash
lm_eval --model hf --model_args pretrained="Intel/phi-2-int4-inc" --device cuda:0 --tasks lambada_openai,hellaswag,piqa,winogrande,truthfulqa_mc1,openbookqa,boolq,arc_easy,arc_challenge,mmlu --batch_size 16
```



| Metric | FP16 | INT4 qdq |
| Metric | FP16 | INT4 |
| -------------- | ------ | -------- |
| Avg. | 0.6155 | 0.6163 |
| mmlu | 0.5448 | 0.5417 |
Expand Down
4 changes: 2 additions & 2 deletions examples/language-modeling/scripts/phi-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python3 main.py \
--group_size 128 \
--bits 4 \
--iters 1000 \
--sym \
--deployment_device 'gpu' \
--disable_trust_remote_code \
--output_dir "./tmp_autoround" \
--disable_quanted_input
--disable_low_gpu_mem_usage