File size: 2,273 Bytes
645b3ac
 
d2b1e51
 
 
 
 
 
645b3ac
d2b1e51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
license: apache-2.0
datasets:
- NeelNanda/pile-10k
language:
- en
tags:
- text-generation-inference
---

## Model Details

This model is an int8 model quantized from [tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b) using SmoothQuant.

## Env setup

[Environment Setup](https://github.com/intel/intel-extension-for-pytorch/tree/release/2.2/examples/cpu/inference/python/llm#3-environment-setup)

## Inferece

Use IPEX 2.2
```bash
git clone https://github.com/intel/intel-extension-for-pytorch.git
cd intel-extension-for-pytorch/examples/cpu/inference/python/llm
git checkout release/2.2
python run.py  --benchmark -m tiiuae/falcon-7b --ipex-smooth-quant --qconfig-summary-file <path to Intel/falcon-7b-sq-int8-inc best_configure.json"> --output-dir "saved_results"
```

## Evaluate

### Evaluate the model 

```bash
git clone https://github.com/intel/intel-extension-for-pytorch.git
cd intel-extension-for-pytorch/examples/cpu/inference/python/llm/single_instance
git checkout release/2.2
python run_accuracy.py -m tiiuae/falcon-7b --quantized-model-path <path to Intel/falcon-7b-sq-int8-inc best_configure.json"> --dtype int8  --tasks lambada_openai
```

### Results

| Metric         | fp32   | int8 sq |
| -------------- | ------ | -------- |
| Avg.           | 0.6982 | 0.6992   |
| lambada_openai | 0.7467 | 0.7648   |
| hellaswag      | 0.5778 | 0.5659   |
| winogrande     | 0.6732 | 0.6717   |
| piqa           | 0.7949 | 0.7943   |


## Ethical Considerations and Limitations

The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

Therefore, before deploying any applications of the model, developers should perform safety testing.

## Caveats and Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Here are a couple of useful links to learn more about Intel's AI software:

* [Intel® Neural Compressor](https://github.com/intel/neural-compressor)
* [Intel® Extension for PyTorch](https://github.com/intel/intel-extension-for-pytorch)