msluszniak commited on
Commit
c6bc873
·
verified ·
1 Parent(s): df203f4

Add XNNPACK int8 export

Browse files
.gitattributes CHANGED
@@ -41,3 +41,4 @@ coreml/all_minilm_l6_v2_coreml_fp32.pte filter=lfs diff=lfs merge=lfs -text
41
  vulkan/all_minilm_l6_v2_vulkan_fp32.pte filter=lfs diff=lfs merge=lfs -text
42
  vulkan/all_minilm_l6_v2_vulkan_fp16.pte filter=lfs diff=lfs merge=lfs -text
43
  coreml/all_minilm_l6_v2_coreml_int8.pte filter=lfs diff=lfs merge=lfs -text
 
 
41
  vulkan/all_minilm_l6_v2_vulkan_fp32.pte filter=lfs diff=lfs merge=lfs -text
42
  vulkan/all_minilm_l6_v2_vulkan_fp16.pte filter=lfs diff=lfs merge=lfs -text
43
  coreml/all_minilm_l6_v2_coreml_int8.pte filter=lfs diff=lfs merge=lfs -text
44
+ xnnpack/all_minilm_l6_v2_xnnpack_int8.pte filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -17,21 +17,36 @@ Upstream model: [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/
17
  | Path | Backend | Precision |
18
  | --- | --- | --- |
19
  | `coreml/all_minilm_l6_v2_coreml_fp16.pte` | coreml | fp16 |
 
20
  | `vulkan/all_minilm_l6_v2_vulkan_fp16.pte` | vulkan | fp16 |
21
  | `xnnpack/all_minilm_l6_v2_xnnpack_fp32.pte` | xnnpack | fp32 |
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  ## Repository structure
24
 
25
  ```
26
  config.json 38 B
27
  coreml/all_minilm_l6_v2_coreml_fp16.pte 43.4 MB
28
- coreml/config.json 929 B
 
29
  tokenizer.json 695 kB
30
  tokenizer_config.json 350 B
31
  vulkan/all_minilm_l6_v2_vulkan_fp16.pte 43.1 MB
32
  vulkan/config.json 929 B
33
  xnnpack/all_minilm_l6_v2_xnnpack_fp32.pte 86.2 MB
34
- xnnpack/config.json 931 B
 
35
  ```
36
 
37
  ## Compatibility
 
17
  | Path | Backend | Precision |
18
  | --- | --- | --- |
19
  | `coreml/all_minilm_l6_v2_coreml_fp16.pte` | coreml | fp16 |
20
+ | `coreml/all_minilm_l6_v2_coreml_int8.pte` | coreml | int8 |
21
  | `vulkan/all_minilm_l6_v2_vulkan_fp16.pte` | vulkan | fp16 |
22
  | `xnnpack/all_minilm_l6_v2_xnnpack_fp32.pte` | xnnpack | fp32 |
23
+ | `xnnpack/all_minilm_l6_v2_xnnpack_int8.pte` | xnnpack | int8 |
24
+
25
+ ## XNNPACK int8
26
+
27
+ `xnnpack/all_minilm_l6_v2_xnnpack_int8.pte` is 8da8w (int8 dynamic activations, int8 per-channel
28
+ weights) on the Linear layers, with an int8 word-embedding table. SQuAD v1.1 dev passage
29
+ retrieval (2000 questions against their 315 paragraphs), dot product:
30
+
31
+ | | top-1 | MRR |
32
+ | --- | --- | --- |
33
+ | fp32 | 57.70 | 0.7012 |
34
+ | int8 | 58.05 | 0.7024 |
35
 
36
  ## Repository structure
37
 
38
  ```
39
  config.json 38 B
40
  coreml/all_minilm_l6_v2_coreml_fp16.pte 43.4 MB
41
+ coreml/all_minilm_l6_v2_coreml_int8.pte 21.8 MB
42
+ coreml/config.json 1.7 kB
43
  tokenizer.json 695 kB
44
  tokenizer_config.json 350 B
45
  vulkan/all_minilm_l6_v2_vulkan_fp16.pte 43.1 MB
46
  vulkan/config.json 929 B
47
  xnnpack/all_minilm_l6_v2_xnnpack_fp32.pte 86.2 MB
48
+ xnnpack/all_minilm_l6_v2_xnnpack_int8.pte 21.9 MB
49
+ xnnpack/config.json 1.5 kB
50
  ```
51
 
52
  ## Compatibility
xnnpack/all_minilm_l6_v2_xnnpack_int8.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1769173f272a41e4371fa2c078795b66a932efbbc25881749e2571ad44cffb1
3
+ size 23010688
xnnpack/config.json CHANGED
@@ -40,6 +40,39 @@
40
  ]
41
  }
42
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  ]
45
  }
 
40
  ]
41
  }
42
  }
43
+ },
44
+ {
45
+ "file": "all_minilm_l6_v2_xnnpack_int8.pte",
46
+ "precision": "int8",
47
+ "methods": {
48
+ "forward": {
49
+ "inputs": [
50
+ {
51
+ "shape": [
52
+ 1,
53
+ 254
54
+ ],
55
+ "dtype": "int64"
56
+ },
57
+ {
58
+ "shape": [
59
+ 1,
60
+ 254
61
+ ],
62
+ "dtype": "int64"
63
+ }
64
+ ],
65
+ "outputs": [
66
+ {
67
+ "shape": [
68
+ 1,
69
+ 384
70
+ ],
71
+ "dtype": "float32"
72
+ }
73
+ ]
74
+ }
75
+ }
76
  }
77
  ]
78
  }