Commit 5ca981f
Fix linear's with permute copy
Summary:
There are some issues with permute_copy in both partitioner as well as convert_to_linear pass
### Partitioner:
For Quantized Partitions, we fail to pull in the q/dq nodes above permute_copy.
```
get_attr --> q --> dq --> permute_copy --> addm
```
The solution is checking the inputs to the source_partition for permute_copy node, and if it is one of them, then we add it to the partition and check its inputs
### Convert to Linear Pass
In the pattern
```
get_attr --> q --> dq --> permute_copy --> addmm
```
We replace the entire source partition with just linear, however we fail to delete the permute_copy because it is an input to the source partition instead of the dq (dq should actually be the input to the linear source partition). The weight given to linear should not be the result of permute copy, but should instead be the input to permute copy.
This happens because q and dq are not tagged as part of the linear source partition, so permute_copy becomes the input to the source partition.
Differential Revision: D48488931
fbshipit-source-id: a650a334cca2ce2e9da8f04805b519a19cbf10111 parent cbedce9 commit 5ca981f
File tree
2 files changed
+5
-0
lines changed- backends/xnnpack
- partition
- passes
2 files changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
685 | 688 | | |
686 | 689 | | |
687 | 690 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
0 commit comments