File size: 1,129 Bytes
6fdc5e7
 
65328e7
 
 
 
 
 
 
 
 
 
 
 
 
 
6fdc5e7
65328e7
0f8d314
65328e7
 
 
d4e876c
 
 
 
65328e7
0f8d314
65328e7
0f8d314
 
d4e876c
45ae2eb
0f8d314
 
 
65328e7
b6c9459
0e0902d
48adad1
0e0902d
65328e7
b6c9459
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
---
license: apache-2.0
datasets:
- lambada
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- text-generation-inference
- causal-lm
- int8
- ONNX
- PostTrainingStatic
- Intel® Neural Compressor
- neural-compressor
---

# INT8 GPT-J 6B

GPT-J 6B is a transformer model trained using Ben Wang's [Mesh Transformer JAX](https://github.com/kingoflolz/mesh-transformer-jax/). "GPT-J" refers to the class of model, while "6B" represents the number of trainable parameters.

This int8 ONNX model is generated by [neural-compressor](https://github.com/intel/neural-compressor) and the fp32 model can be exported with below command:
```shell
python -m transformers.onnx --model=EleutherAI/gpt-j-6B onnx_gptj/ --framework pt --opset 13 --feature=causal-lm-with-past
```

## Test result

|   |INT8|FP32|
|---|:---:|:---:|
| **Lambada Acc** |0.7944|0.7954|
| **Model size (GB)**  |6|23|


## How to use

Download the model and script by cloning the repository:
```shell
git clone https://huggingface.co/Intel/gpt-j-6B-int8-static
```

Then you can do inference based on the model and script 'evaluation.ipynb'.