Views
No views yet
1git clone https://github.com/intel/auto-round
2cd auto-round
3pip install -r requirements.txt
4cd examples/language-modeling
5pip install -r requirements.txt
6python3 main.py \
7--model_name Intel/neural-chat-7b-v3-3 \
8--device 0 \
9--group_size 128 \
10--bits 4 \
11--iters 1000 \
12--enable_minmax_tuning \
13--minmax_lr 0.002 \
14--deployment_device 'gpu' \
15--scale_dtype 'fp32' \
16--disable_quanted_input \
17--eval_bs 32 \
18--output_dir "./tmp_autoround" \
19--amp
201from intel_extension_for_transformers.transformers import AutoModelForCausalLM
2from transformers import AutoTokenizer
3quantized_model_dir = "Intel/neural-chat-7b-v3-3-int4-inc"
4model = AutoModelForCausalLM.from_pretrained(quantized_model_dir,
5 device_map="auto",
6 trust_remote_code=False,
7 use_neural_speed=False,
8 )
9tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir, use_fast=True)
10print(tokenizer.decode(model.generate(**tokenizer("There is a girl who likes adventure,", return_tensors="pt").to(model.device),max_new_tokens=50)[0]))
11"""
12 <s> There is a girl who likes adventure, and she is a bit of a daredevil. She loves to travel and explore new places. She is always looking for the next thrill, whether it be skydiving, bungee jumping, or even just hiking up a mountain
13"""1from transformers import AutoModelForCausalLM, AutoTokenizer
2quantized_model_dir = "Intel/neural-chat-7b-v3-3-int4-inc"
3model = AutoModelForCausalLM.from_pretrained(quantized_model_dir,
4 device_map="auto",
5 trust_remote_code=False,
6 )
7tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir, use_fast=True)
8print(tokenizer.decode(model.generate(**tokenizer("There is a girl who likes adventure,", return_tensors="pt").to(model.device),max_new_tokens=50)[0]))lm_eval --model hf --model_args pretrained="Intel/neural-chat-7b-v3-3-int4-inc",autogptq=True,gptq_use_triton=True --device cuda:0 --tasks lambada_openai,hellaswag,piqa,winogrande,truthfulqa_mc1,openbookqa,boolq,rte,arc_easy,arc_challenge,mmlu --batch_size 128| Metric | FP16 | INT4 |
|---|---|---|
| Avg. | 0.6778 | 0.6748 |
| mmlu | 0.5993 | 0.5926 |
| lambada_openai | 0.7303 | 0.7370 |
| hellaswag | 0.6639 | 0.6559 |
| winogrande | 0.7632 | 0.7735 |
| piqa | 0.8101 | 0.8074 |
| truthfulqa_mc1 | 0.4737 | 0.4737 |
| openbookqa | 0.3880 | 0.3680 |
| boolq | 0.8694 | 0.8694 |
| rte | 0.7581 | 0.7509 |
| arc_easy | 0.8266 | 0.8249 |
| arc_challenge | 0.5734 | 0.5691 |