File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
backends/xnnpack/partition/config Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 10
10
from typing import List , Optional
11
11
12
12
import torch
13
+ from executorch .backends .xnnpack .utils .quant_utils import (
14
+ is_dequant ,
15
+ is_qparam ,
16
+ is_quant ,
17
+ )
13
18
from executorch .exir .backend .canonical_partitioners .config_partitioner import (
14
19
format_target_name ,
15
20
PartitionerConfig ,
@@ -223,9 +228,18 @@ def _check_node_has_valid_dtype(self, node):
223
228
valid_dtypes = {
224
229
torch .float32 ,
225
230
torch .float16 ,
226
- torch .int8 ,
227
- torch .qint8 ,
228
231
}
232
+ # Only allow int8 and quant dtypes for quant operations
233
+ if is_quant (node ) or is_dequant (node ) or is_qparam (node ):
234
+ valid_dtypes .update (
235
+ {
236
+ torch .qint32 ,
237
+ torch .qint8 ,
238
+ torch .quint8 ,
239
+ torch .int8 ,
240
+ }
241
+ )
242
+
229
243
if (
230
244
node .op != "placeholder"
231
245
and node .op != "call_function"
You can’t perform that action at this time.
0 commit comments