File size: 1,923 Bytes
1c861e7
 
17b85b7
 
 
 
 
 
 
 
 
 
 
 
 
 
1c861e7
17b85b7
f41827e
17b85b7
 
 
65e2058
 
 
 
17b85b7
f41827e
 
 
 
 
 
 
 
 
17b85b7
f41827e
 
 
 
 
17b85b7
 
f41827e
17b85b7
 
 
55d5655
17b85b7
 
f41827e
 
 
 
 
 
 
 
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
---
license: apache-2.0
datasets:
- lambada
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- text-generation-inference
- causal-lm
- int8
- ONNX
- PostTrainingDynamic
- Intel® Neural Compressor
- neural-compressor
---

## Model Details: 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
```

| Model Detail | Description |
| ----------- | ----------- | 
| Model Authors - Company | Intel | 
| Date | April 10, 2022 | 
| Version | 1 | 
| Type | Text Generation | 
| Paper or Other Resources | - | 
| License | Apache 2.0 |
| Questions or Comments | [Community Tab](https://huggingface.co/Intel/gpt-j-6B-int8-dynamic/discussions)|

| Intended Use | Description |
| ----------- | ----------- | 
| Primary intended uses | You can use the raw model for text generation inference | 
| Primary intended users | Anyone doing text generation inference | 
| Out-of-scope uses | This model in most cases will need to be fine-tuned for your particular task.  The model should not be used to intentionally create hostile or alienating environments for people.|


### How to use

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

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

## Metrics (Model Performance):
| Model  | Model Size (GB) | Lambada Acc |
|---|:---:|:---:|
| FP32 |23|0.7954|
| INT8 |6|0.7926|