xinhe commited on
Commit
a6c0703
·
2 Parent(s): a169aae daa0069

Merge branch 'main' of https://huggingface.co/Intel/bart-large-cnn-int8-dynamic into main

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md CHANGED
@@ -1,3 +1,59 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ tags:
4
+ - int8
5
+ - Intel® Neural Compressor
6
+ - neural-compressor
7
+ - PostTrainingDynamic
8
+ datasets:
9
+ - cnn_dailymail
10
+ metrics:
11
+ - rougeLsum
12
  ---
13
+
14
+ # INT8 DistilBart finetuned on CNN DailyMail
15
+
16
+ ### Post-training dynamic quantization
17
+
18
+ This is an INT8 PyTorch model quantized with [huggingface/optimum-intel](https://github.com/huggingface/optimum-intel) through the usage of [Intel® Neural Compressor](https://github.com/intel/neural-compressor).
19
+
20
+ The original fp32 model comes from the fine-tuned model [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn).
21
+
22
+ Below linear modules (40/193) are fallbacked to fp32 for less than 1% relative accuracy loss:
23
+
24
+ **'model.decoder.layers.10.fc1'**, **'model.decoder.layers.0.fc2'**,
25
+ **'model.decoder.layers.4.fc2'**, **'model.decoder.layers.1.fc2'**,
26
+ **'model.decoder.layers.6.fc2'**, **'model.decoder.layers.2.fc2'**,
27
+ **'model.decoder.layers.3.fc2'**, **'model.encoder.layers.11.fc2'**,
28
+ **'model.decoder.layers.9.fc1'**, **'model.decoder.layers.5.fc2'**,
29
+ **'model.decoder.layers.7.fc1'**, **'model.decoder.layers.8.fc1'**,
30
+ **'model.encoder.layers.0.fc2'**, **'model.decoder.layers.11.fc1'**,
31
+ **'model.encoder.layers.8.fc2'**, **'model.encoder.layers.11.fc1'**,
32
+ **'model.decoder.layers.8.fc2'**, **'model.decoder.layers.2.fc1'**,
33
+ **'model.decoder.layers.11.self_attn.v_proj'**, **'model.encoder.layers.9.fc1'**,
34
+ **'model.decoder.layers.9.fc2'**, **'model.decoder.layers.7.fc2'**,
35
+ **'model.decoder.layers.6.fc1'**, **'model.decoder.layers.0.fc1'**,
36
+ **'model.decoder.layers.1.self_attn.v_proj'**, **'model.encoder.layers.3.fc1'**,
37
+ **'model.encoder.layers.2.fc2'**, **'model.encoder.layers.7.fc2'**,
38
+ **'model.decoder.layers.3.fc1'**, **'model.encoder.layers.1.fc2'**,
39
+ **'model.encoder.layers.10.fc2'**, **'model.encoder.layers.8.fc1'**,
40
+ **'lm_head'**, **'model.decoder.layers.6.self_attn.v_proj'**,
41
+ **'model.decoder.layers.11.self_attn.out_proj'**, **'model.decoder.layers.11.encoder_attn.v_proj'**,
42
+ **'model.encoder.layers.10.fc1'**, **'model.encoder.layers.6.fc1'**,
43
+ **'model.decoder.layers.4.fc1'**, **'model.decoder.layers.1.fc1'**
44
+
45
+ ### Evaluation result
46
+
47
+ | |INT8|FP32|
48
+ |---|:---:|:---:|
49
+ | **Accuracy (eval-rougeLsum)** | 41.2224 | 41.5274 |
50
+ | **Model size** |625M|1669M|
51
+
52
+ ### Load with optimum:
53
+
54
+ ```python
55
+ from optimum.intel.neural_compressor.quantization import IncQuantizedModelForSeq2SeqLM
56
+ int8_model = IncQuantizedModelForSeq2SeqLM.from_pretrained(
57
+ 'Intel/bart-large-cnn-int8-dynamic',
58
+ )
59
+ ```