msluszniak commited on
Commit
f7eff56
·
1 Parent(s): 5e4a805

QNN: DeepLabV3-MobileNetV3 a16w8, one context binary per Hexagon version

Browse files

66.55% mIoU on VOC2012 val (200 images) against 66.56% for the XNNPACK int8
file, at 3.20 ms/inference on an S26 Ultra. Returns a class index per pixel,
(1,520,520) int32, instead of (1,21,520,520) logits.

README.md CHANGED
@@ -25,6 +25,26 @@ Upstream model: [DeepLabV3](https://docs.pytorch.org/vision/main/models/deeplabv
25
  | `xnnpack/deeplab_v3_resnet50_xnnpack_int8.pte` | xnnpack | int8 |
26
  | `xnnpack/deeplab_v3_resnet101_xnnpack_fp32.pte` | xnnpack | fp32 |
27
  | `xnnpack/deeplab_v3_resnet101_xnnpack_int8.pte` | xnnpack | int8 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## Unshipped backends
30
 
 
25
  | `xnnpack/deeplab_v3_resnet50_xnnpack_int8.pte` | xnnpack | int8 |
26
  | `xnnpack/deeplab_v3_resnet101_xnnpack_fp32.pte` | xnnpack | fp32 |
27
  | `xnnpack/deeplab_v3_resnet101_xnnpack_int8.pte` | xnnpack | int8 |
28
+ | `qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v69.pte` | qnn | a16w8 |
29
+ | `qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v73.pte` | qnn | a16w8 |
30
+ | `qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v75.pte` | qnn | a16w8 |
31
+ | `qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v79.pte` | qnn | a16w8 |
32
+ | `qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v81.pte` | qnn | a16w8 |
33
+
34
+ ## QNN variants
35
+
36
+ A QNN `.pte` embeds an HTP context binary compiled for one Hexagon version, so
37
+ there is one file per version and the runtime picks the one matching the device.
38
+ These return a class index per pixel, `(1, 520, 520)` int32, rather than
39
+ `(1, 21, 520, 520)` logits.
40
+
41
+ | Hexagon | Example SoC |
42
+ | --- | --- |
43
+ | v69 | Snapdragon 8 Gen 1 |
44
+ | v73 | Snapdragon 8 Gen 2 |
45
+ | v75 | Snapdragon 8 Gen 3 |
46
+ | v79 | Snapdragon 8 Elite |
47
+ | v81 | Snapdragon 8 Elite Gen 5 |
48
 
49
  ## Unshipped backends
50
 
qnn/config.json ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://huggingface.co/software-mansion/react-native-executorch-spec/resolve/main/config.schema.json",
3
+ "model": "deeplab_v3",
4
+ "family": "deeplab",
5
+ "capabilities": [
6
+ "semantic-segmentation"
7
+ ],
8
+ "backend": "qnn",
9
+ "license": "bsd-3-clause",
10
+ "variants": [
11
+ {
12
+ "file": "deeplab_v3_mobilenet_v3_large_qnn_a16w8_v69.pte",
13
+ "precision": "a16w8",
14
+ "quantized": true,
15
+ "default": false,
16
+ "size": "mobilenet_v3_large",
17
+ "methods": {
18
+ "forward": {
19
+ "inputs": [
20
+ {
21
+ "shape": [
22
+ 1,
23
+ 3,
24
+ 520,
25
+ 520
26
+ ],
27
+ "dtype": "float32"
28
+ }
29
+ ],
30
+ "outputs": [
31
+ {
32
+ "shape": [
33
+ 1,
34
+ 520,
35
+ 520
36
+ ],
37
+ "dtype": "int32"
38
+ }
39
+ ]
40
+ }
41
+ }
42
+ },
43
+ {
44
+ "file": "deeplab_v3_mobilenet_v3_large_qnn_a16w8_v73.pte",
45
+ "precision": "a16w8",
46
+ "quantized": true,
47
+ "default": false,
48
+ "size": "mobilenet_v3_large",
49
+ "methods": {
50
+ "forward": {
51
+ "inputs": [
52
+ {
53
+ "shape": [
54
+ 1,
55
+ 3,
56
+ 520,
57
+ 520
58
+ ],
59
+ "dtype": "float32"
60
+ }
61
+ ],
62
+ "outputs": [
63
+ {
64
+ "shape": [
65
+ 1,
66
+ 520,
67
+ 520
68
+ ],
69
+ "dtype": "int32"
70
+ }
71
+ ]
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "file": "deeplab_v3_mobilenet_v3_large_qnn_a16w8_v75.pte",
77
+ "precision": "a16w8",
78
+ "quantized": true,
79
+ "default": false,
80
+ "size": "mobilenet_v3_large",
81
+ "methods": {
82
+ "forward": {
83
+ "inputs": [
84
+ {
85
+ "shape": [
86
+ 1,
87
+ 3,
88
+ 520,
89
+ 520
90
+ ],
91
+ "dtype": "float32"
92
+ }
93
+ ],
94
+ "outputs": [
95
+ {
96
+ "shape": [
97
+ 1,
98
+ 520,
99
+ 520
100
+ ],
101
+ "dtype": "int32"
102
+ }
103
+ ]
104
+ }
105
+ }
106
+ },
107
+ {
108
+ "file": "deeplab_v3_mobilenet_v3_large_qnn_a16w8_v79.pte",
109
+ "precision": "a16w8",
110
+ "quantized": true,
111
+ "default": false,
112
+ "size": "mobilenet_v3_large",
113
+ "methods": {
114
+ "forward": {
115
+ "inputs": [
116
+ {
117
+ "shape": [
118
+ 1,
119
+ 3,
120
+ 520,
121
+ 520
122
+ ],
123
+ "dtype": "float32"
124
+ }
125
+ ],
126
+ "outputs": [
127
+ {
128
+ "shape": [
129
+ 1,
130
+ 520,
131
+ 520
132
+ ],
133
+ "dtype": "int32"
134
+ }
135
+ ]
136
+ }
137
+ }
138
+ },
139
+ {
140
+ "file": "deeplab_v3_mobilenet_v3_large_qnn_a16w8_v81.pte",
141
+ "precision": "a16w8",
142
+ "quantized": true,
143
+ "default": true,
144
+ "size": "mobilenet_v3_large",
145
+ "methods": {
146
+ "forward": {
147
+ "inputs": [
148
+ {
149
+ "shape": [
150
+ 1,
151
+ 3,
152
+ 520,
153
+ 520
154
+ ],
155
+ "dtype": "float32"
156
+ }
157
+ ],
158
+ "outputs": [
159
+ {
160
+ "shape": [
161
+ 1,
162
+ 520,
163
+ 520
164
+ ],
165
+ "dtype": "int32"
166
+ }
167
+ ]
168
+ }
169
+ }
170
+ }
171
+ ]
172
+ }
qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v69.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30588189e6b35a229f651e237cb38a4a51a6413ec005abf99f3c72169e290d06
3
+ size 15001088
qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v73.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba3e3b923bcf0d9f2dc2c6de1c5da9eeae7677db5b42596097f1118466b86d27
3
+ size 12760576
qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v75.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e4dff48666de9513194a49420d69a849e08a8f65408b07e2f991b2471ee5c54
3
+ size 12764672
qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v79.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd0a2d84825370126f6634f70b36a5644b4652384a0718fd9d4a3ddbf947a1ac
3
+ size 12760576
qnn/deeplab_v3_mobilenet_v3_large_qnn_a16w8_v81.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36221ea5e11a9581d1b308fabc92a3bcaa3a2ffeeb6eadc00ce6d2587a416e46
3
+ size 12805632