xinhe commited on
Commit
ccf3347
1 Parent(s): 83aa1b2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md CHANGED
@@ -1,3 +1,59 @@
1
  ---
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
  license: apache-2.0
5
+ tags:
6
+ - multiple-choice
7
+ - int8
8
+ - PostTrainingStatic
9
+ datasets:
10
+ - swag
11
+ metrics:
12
+ - accuracy
13
+ model-index:
14
+ - name: bert-base-uncased-finetuned-swag-int8-static
15
+ results:
16
+ - task:
17
+ name: Multiple-choice
18
+ type: multiple-choice
19
+ dataset:
20
+ name: Swag
21
+ type: swag
22
+ metrics:
23
+ - name: Accuracy
24
+ type: accuracy
25
+ value: 0.7838148474693298
26
  ---
27
+ # INT8 bert-base-uncased-finetuned-swag
28
+
29
+ ### Post-training static quantization
30
+
31
+ This is an INT8 PyTorch model quantized with [Intel® Neural Compressor](https://github.com/intel/neural-compressor).
32
+
33
+ The original fp32 model comes from the fine-tuned model [thyagosme/bert-base-uncased-finetuned-swag](https://huggingface.co/thyagosme/bert-base-uncased-finetuned-swag).
34
+
35
+ The calibration dataloader is the train dataloader. The default calibration sampling size 100 isn't divisible exactly by batch size 8, so the real sampling size is 104.
36
+
37
+ ### Test result
38
+
39
+ - Batch size = 8
40
+ - [Amazon Web Services](https://aws.amazon.com/) c6i.xlarge (Intel ICE Lake: 4 vCPUs, 8g Memory) instance.
41
+
42
+ | |INT8|FP32|
43
+ |---|:---:|:---:|
44
+ | **Throughput (samples/sec)** |16.55|9.333|
45
+ | **Accuracy (eval-accuracy)** |0.7838|0.7915|
46
+ | **Model size (MB)** |133|418|
47
+
48
+ ### Load with Intel® Neural Compressor (build from source):
49
+
50
+ ```python
51
+ from neural_compressor.utils.load_huggingface import OptimizedModel
52
+ int8_model = OptimizedModel.from_pretrained(
53
+ 'Intel/bert-base-uncased-finetuned-swag-int8-static',
54
+ )
55
+ ```
56
+
57
+ Notes:
58
+ - The INT8 model has better performance than the FP32 model when the CPU is fully occupied. Otherwise, there will be the illusion that INT8 is inferior to FP32.
59
+