File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
backends/xnnpack/partition Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 7
7
import torch
8
8
from executorch .exir .dialects ._ops import ops as exir_ops
9
9
10
- ###
11
- ### Module based partitioners
12
- ###
10
+ """
11
+ ** How to incorporate a new op into the XNNPACK Partitioner? **
12
+
13
+ [1] When the new edge op being added is direct descendent of a core-aten op,
14
+ and is also supported* by XNNPACK, prefer partitioning it via SUPPORTED_OPS
15
+ mechanism e.g. torch.add
16
+
17
+ [2] When the new op being added is not a core-aten op,
18
+
19
+ [2.1] If the original torch op is supported* by XNNPACK, prefer partitioning it
20
+ via SUPPORTED_MODULES. This will require "recomposing" the op before lowering
21
+ it to XNNPACK e.g. torch.nn.Linear. Make sure to include all variants of the
22
+ modules in the SUPPORTED_MODULES list.
23
+
24
+ [2.2] If the original torch op is not supported by XNNPACK, then it is assumed
25
+ that out of all the decomposed core-aten ops, SUPPORTED_OPS will be lowered to
26
+ XNNPACK.
27
+
28
+ * - Supported fully or partially. The partial support does not mean only few
29
+ ops from the decomposition but means only some variants of the op "modes"
30
+ possible with the arg combinations.
31
+ """
13
32
14
33
SUPPORTED_OPS = [
15
34
exir_ops .edge .aten .div .Tensor ,
You can’t perform that action at this time.
0 commit comments